Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have on action method in controller and i want to pass the value of textbox to controller but problem is that i cant pass the value is seem like null value in controller.
I have login button, has popup on nav bar it run on only index view but whenever i goes through other view and click on button popup shows and when putting username and pasword then click on login button it pass null values to controller

What I have tried:







<a href="@url.action("Login","Home",new{username,password})"



**controller**
public actionresult login(string username,string password){
return view();
}
Posted
Updated 19-Dec-16 20:31pm

1 solution

Hello,

Try this:

JavaScript
<a target="_blank" href="@Url.Action("login","Home", new { username = "txtUserNameValue", password = "txtPassword"})"></a>

Thanks
Ajay
 
Share this answer
 
Comments
Member 12270370 20-Dec-16 7:05am    
Sir actually i have created nav bar and it work until im on home/index view screen but when i m on another page and click on login its shows popup and after filling data into textbox click on login button then it passes only null value
Ajay-Systematix 21-Dec-16 7:18am    
I am creating you end scenario on my end. Let's check the cause. Or if you can share your code here. That's good for me.

Thanks
Ajay

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