forum

Home / DeveloperSection / Forums / How to use textbox and ViewBag value in controller method?

How to use textbox and ViewBag value in controller method?

Mark M 2277 26-Nov-2014
@using (Html.BeginForm("sendcode","Home", FormMethod.Post))
{
<div class="selected">You Selected:</div>
<div class="sname">@ViewBag.selectsong</div>
<div class="enter"style="width:458px;height:37px; text-align:left;">
<div class="selected">Enter your mobile number</div>
<div class="mobileno">
<div><div class="spann">+91</div><input name="MNumber" type="text" class="mobileinput"/></div></div>`enter code here`
<div class="confirm"><input name="" type="button" class="confirmb"value="Confirm"onclick="location.href='@Url.Action("getdetail", "Home" )'/>
</div>
<div class="applicablee">* charges applicable as per your mobile operators</div>
</div>
}

I want to use textbox value and ViewBag value on my controller method which has been defined below?

 

public string getdetail(string Mnumber, string sSongName)
{
    string ss =Mnumber;
    string ss1 =sSongName;
    return ss;
}


Updated on 27-Nov-2014

Can you answer this question?


Answer

1 Answers

Liked By