querystring drop down menu mvc asp.net selected item list -
I want to type query string if conditions = 2
I have a drop down menu in this menu I position which is {main, left, top, bottom} If I wrote in my local host localhost: 27593 admin create items? Type = 2 should be in position I just left in asp.net and mvc and want to write the main code correct plz help me
Create a public function (int? Id) {/ / Querystring // 2 ise int TYPEE = HttpUtility.UrlDecode (Request.QueryString ["typee"]); String [] separateURL = url.Split ('?'); NameValueCollection queryString = System.Web.HttpUtility.ParseQueryString (separateWorld [1]); If (TYPEE == 2) {SelectListItem [] item = New SelectListItem [2]; Item [0] = new selection list name "main", "1"); Items [1] = new selection list ("left", "2"); DropDownList1.Items.AddRange (item); DropDownList1.DataBind (); } Else {SelectListItem [] items = new selection list [5]; Item [0] = new selection list ("main", "1"); Items [1] = new selection list ("left", "2"); Item [2] = new selection list ("correct", "3"); Item [3] = new selection list ("top", "4"); Item [3] = new selection list ("below", "5"); DropDownList1.Items.AddRange (item); DropDownList1.DataBind (); See Return ();
Why do not you just use?
Create a public function (int type, int? Id) Thus, the default model binder will force the variable type value from the query type. Edit:
I've still seen a typo, you're looking for the 'typee' key in the QueryString collection, though there is no such key in it, only 'type The key is there.
int tvpe = htpuity.urlcode (request.cootstring ["type"])
Comments
Post a Comment