how to submit a form based on a condition in C#
-
Hi All, Wish all of you a very happy new year.....:) I want to submit a form based on a condition as I am doing with ASP. I have a user login form and i m checking the username and password with the database (SQLServer 2000). I want to do it in C# using ASP.net User will fill the form, username and password will be checked from the database. If no record found, form will be submitted on login.aspx, and if record found, it will be submitted on account.aspx. I m doing this by ASP code, but I want to use this in C# (Code behind) so that no body can see my code as it will be go will dll... I also don't want to use Response.Redirect()...
function Validate() { document.login.submit(); } Validate(); Is there any way ???? Regards,:) Suman Singh:-O -- modified at 7:46 Thursday 5th January, 2006
-
Hi All, Wish all of you a very happy new year.....:) I want to submit a form based on a condition as I am doing with ASP. I have a user login form and i m checking the username and password with the database (SQLServer 2000). I want to do it in C# using ASP.net User will fill the form, username and password will be checked from the database. If no record found, form will be submitted on login.aspx, and if record found, it will be submitted on account.aspx. I m doing this by ASP code, but I want to use this in C# (Code behind) so that no body can see my code as it will be go will dll... I also don't want to use Response.Redirect()...
function Validate() { document.login.submit(); } Validate(); Is there any way ???? Regards,:) Suman Singh:-O -- modified at 7:46 Thursday 5th January, 2006
Put
runat="server"
in the fields and use id to identify them:<input type="hidden" id="CustNum" runat="server"/> <input type=hidden id="mode" ruant="server"/>
Now you can declare them in code-behind:protected HtmlInputHidden CustNum, mode;
And set the values:CustNum.Value = "42"; mode.Value = "Paranoid";
--- b { font-weight: normal; } -- modified at 8:15 Thursday 5th January, 2006 -
Put
runat="server"
in the fields and use id to identify them:<input type="hidden" id="CustNum" runat="server"/> <input type=hidden id="mode" ruant="server"/>
Now you can declare them in code-behind:protected HtmlInputHidden CustNum, mode;
And set the values:CustNum.Value = "42"; mode.Value = "Paranoid";
--- b { font-weight: normal; } -- modified at 8:15 Thursday 5th January, 2006and what will be the code to submit the form....
-
and what will be the code to submit the form....