Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0form Post Values hiddenlyform Post Values hiddenly
Previous
 
Next
New Post
7/19/2008 3:12 AM
 

Hi All,

         Can Anybody please me on this. I am developing a module which needs to post values to the url specified. I will provide the Text Description and also the parameters names and values which are all stored in the DB and i will also specify the format of how the url will be. I need to know how can i post the values from the backend since this needs a form tag in the frontend and ascx controls wont accept another form tag to be placed in it as there is already one. So we need to do this from the code behind, please provide some sample code as i tried various opions for this and i need this very urgently.

Thanks,

Sandeep.M

 
New Post
7/21/2008 5:03 AM
 

Hi,

     please help its really urgent. I hope you got my question. Let me explain once again . I am developing a link and redirect module for my client. The main control shows a set of links which will redirect to another external url, or a dnn page on the site etc and how the link should be displayed can be set in the settings. There's also a link type called httppost in which  i will give the url format and also the paarameters in the format for ex in the settings in the urlformat for the link i will specify in the following way (http://www.xyz.com/Default.aspx?{Tag1}={Tag2}&{Tag3}={Tag4} ) where Tag1,Tag2,Tag3 and Tag4 are defined by admin in the settings whether its a static value or Dynamic value. Now the thing is when i select the link type as http post and add the link from the view when clicked on the link i need to post the values specified to the url. where {Tag1},{Tag3} are names of params and {Tag2},{Tag4} are values of params.

How can i do this. please help

Thanks,

Sandeep.M

 
New Post
7/21/2008 8:50 AM
 

Sandeep,
                 This is pretty standard asp.net stuff realy. If you are trying to do this via a postback, as in using a form button control of some kind, then in your codebehind simply format your url and pass the values to Reponse.Redirect(myurl) . myurl being a string with the url assigned to it.
Or you can format an anchor and insert the url into it in your codebehind on pageload <asp:hyperlink .... This way the form control won't postback to the dnn page and will just link to your new page/site.

Hope this helps.

 
New Post
7/24/2008 10:51 AM
 

Hi All,

Thanks Mathew Let me explain clearly for all i still need som more clear explanation

        I am developing a DNN Module which has several links and can be redirected to the corresponding site  when clicked on the link. There are different Types of links displayed based on the settings. Types of Links are Normal Text Link (where a text desc is given and the url is typed for which it has to be redirected) and there will an image displayed instead of Text desc and for this also there will be url given for which it has to be redirected to also we can pass the parameters which are also defined and the format for the url will be given like this (http://www.xyz.com?{Tag1}={Tag2}) where the values of tag1 and tag2 are also defined. I amable to do it through navigate url perfectly.

By placing place holders and setting the visible conditions in the temlate column i am able to do it

 The problem  is now i have another link type http post where the url format is given similarily but the thing is parameters should not be visible here since it must be done through post method. How can i achieve this . i sat on it since last 2 days with no success. Please provide some sample code on how to achieve this. I can retrieve the parameters and url successfully on click event of the link through databind i have called this But how can i redirect it please provide some sample code

I am posting my code here to give you a better idea

My Datagrids template column has the following

   <asp:TemplateColumn ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                <Itemtemplate>
                      <asp:PlaceHolder ID="PlaceHolder9" runat="server" Visible='<% # IIf((Eval("LinkType") = 3 and (Eval("RedirectId") =  rue)),true,false)%>'>
                       <asp:ImageButton Runat="server" ID="lnkHttpPost" OnCommand="lnkHttpPost_Command" ImageUrl='<% #Eval("ImagePath") %>' style="border:0px" CommandName='<%# DataBinder.Eval(Container, "DataItem.UrlId")%>' />
                    </asp:PlaceHolder>
                </ItemTemplate>
           </asp:TemplateColumn>

 

And my code behind file has the following

  Protected Sub lstUrls_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles lstUrls.ItemDataBound
            Dim lnkDeleteUrl As ImageButton
            lnkDeleteUrl = CType(e.Item.FindControl("lnkDeleteUrl"), System.Web.UI.WebControls.ImageButton)
            If Not lnkDeleteUrl Is Nothing Then
                ClientAPI.AddButtonConfirm(lnkDeleteUrl, Localization.GetString("DeleteItem.Text", LocalResourceFile))
            End If

            Dim lnkHttpPost As ImageButton
            lnkHttpPost = CType(e.Item.FindControl("lnkHttpPost"), System.Web.UI.WebControls.ImageButton)
        End Sub

  Protected Sub lnkHttpPost_Command(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs)
            postUrl(e.CommandName)
        End Sub

      Sub postUrl(ByVal UrlId As Integer)
            If Not Null.IsNull(UrlId) Then
                Dim Tag, TagValue As String
                Dim objGetUrl As RedirectInfo
                objGetUrl = RedirectController.GetRedirectUrl(UrlId)
                Dim HttpPostImagePath As String
                HttpPostImagePath = objGetUrl.URLformat
                While objGetUrl.URLformat.IndexOf("{") > 0 AndAlso objGetUrl.URLformat.IndexOf("}") > objGetUrl.URLformat.IndexOf("{")
                    Tag = objGetUrl.URLformat.Substring(objGetUrl.URLformat.IndexOf("{") + 1, objGetUrl.URLformat.IndexOf("}") - objGetUrl.URLformat.IndexOf("{") - 1)
                    TagValue = GetTagValue(Tag)
                    objGetUrl.URLformat = objGetUrl.URLformat.Replace("{" & Tag & "}", TagValue)
                End While

                Dim MainString As String = objGetUrl.URLformat
                Dim Split As String() = MainString.Split(New Char() {"?"})
                posturlstring = Split(0)
                postparameters = Split(1)

where posturl  gets the website url (http://www.xyz.com) and post params gets the parameters based on values like (option=com_content&viewid=23) etc

I have written it like this can anybody please help on this i need it really quickly

Thanks,

Sandeep.M

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0form Post Values hiddenlyform Post Values hiddenly


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out