Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

We have an application in ASP.NET windows,where we pass user credentials on button click to a web application page.We need to retreive the passed varaiables in the page load of the web page.

We passed the varaiables in the below mentioned format through windows application.
string strUrl = "http://localhost:50541/ZenjICTCTransaction/Login.aspx?UserID=" + tbUserID.Text + "&Password=" + tbPassword.Text + "";
Process.Start("iexplore", strUrl);


In the login page we need to get the varaibale values.We tried to retreive using

VB
Dim UserID As String = Request.Form("UserID")
        Dim UserPass As String = Request.Form("Pasword")



But the value is not getting.

Please help

Regards
Sreejith
Posted
Comments
anup.bhunia 4-May-15 9:32am    
Try to use Request.Params("UserID")

But how you are trying to implement the authentication is not good way. We should never send password as query string.
Member 11658469 4-May-15 9:45am    
HI,

Thanks for the reply.

Till now the solution didnt get.The above mentioned method also tried but no result.

Regards
Sreejith

1 solution

Hi,

If your passing data by appending it to the url, you would use the Request objects QueryString[^] method to retrieve the values.

Have look at this article for some more examples Passing variables between pages using QueryString[^]

To use the Request.Form Collection[^] example you posted, would require you to add the values to the form collection, and then post the form.

... hope it helps.
 
Share this answer
 
Comments
Member 11658469 4-May-15 9:47am    
Hi ,

Actually we know to retreiving the parameter from one web page to another.We need the querystring value from passed web page from windows application and get the value in a web page.

Regards
Sreejith
hypermellow 4-May-15 9:55am    
Hi,
The URL in the code snippet you posted is an ASP.NET aspx file?
It doesn't matter what built the request to that page, the value will be available in the QueryString?

Why can't you use:
Dim UserID As String = Request.QueryString("UserID")
Member 11658469 4-May-15 10:50am    
Hi,

Till now we cant able to get the value.The variables are passing but the thing is the code we need to exceute in the pageload of the invoked page is not executing.

Regards
Sreejith
hypermellow 4-May-15 11:01am    
That sounds like a different question/problem ...

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack
Dim UserID As String = Request.QueryString("UserID")
End If
End Sub

What happens when you set a break point on If Not Page.IsPostBack?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900