Stack Exchange
set parameter for textbox in http request in c#
I want to login through some site with my C# code and login page has a username and a password textbox with ids as below
    
<input name="login:password" class="ui-inputfield ui-password ui-widget ui-state-default ui-corner-all" id="login:password" role="textbox" aria-disabled="false" aria-readonly="false" aria-multiline="false" type="password" size="40" autocomplete="off">

and my c# code for getting response text is ..
string responseText = httpRequestFactory.Create(url)
                .SetKeepAlive(false)
                .SetMethod(HttpMethods.Post)
                .SetContentType(ContentTypes.MultiPartFormDataWithBoundary)
                .SetReferer(url)
                .AddParameter("login:loginName", username)
                .AddParameter("login:password", password)
                .GetResponse()
                .GetResponseAsString();

How can I login successfully with changes in my C# code?
Please help me.

Your input is not a server control. To do what you are trying to do would require you to use runat="server" but then your control names would need to be set to static. I would consider using ajax instead to send the inputs values to the server and handle your login there. Then you are really not concerned with the input's name, just the value you are passing.

you are correct.but the site on which i want to perforn a login is third party web.
