tag:blogger.com,1999:blog-6082652835152798567.post4195945572402169476..comments2024-03-18T11:30:52.140-07:00Comments on Sql server, .net and c# video tutorial: Part 38 - CheckBoxList in asp.net mvcUnknownnoreply@blogger.comBlogger25125tag:blogger.com,1999:blog-6082652835152798567.post-29165437287301375712024-02-26T03:36:21.268-08:002024-02-26T03:36:21.268-08:00how to save the values in the checkbox to databas...how to save the values in the checkbox to database Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-87206975071142910942024-02-02T02:38:55.006-08:002024-02-02T02:38:55.006-08:00how to implement in a class because there is multi...how to implement in a class because there is multiple propertiesAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-68242997505647050872020-12-13T06:59:18.547-08:002020-12-13T06:59:18.547-08:00Instance of data context class connects with the m...Instance of data context class connects with the model containing the 'City' class generated from the tblCity database table and it has got all the table coloumns as properties of the 'City' data model classDebarghya_23https://www.blogger.com/profile/05934478917903847293noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-66807314258647772092020-12-13T06:54:54.851-08:002020-12-13T06:54:54.851-08:00When we check the check boxes and click on submit,...When we check the check boxes and click on submit, the form is posted back to the server and the Index action method decorated with Http post attribute gets executed. It receives the list of checked check boxes and hence the name of the cities associated with them. Int the output stream it returns the names.Debarghya_23https://www.blogger.com/profile/05934478917903847293noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-9967643391557927552020-08-12T04:03:07.946-07:002020-08-12T04:03:07.946-07:00your folder name should be like this "EditorT...your folder name should be like this "EditorTemplates" it will solve the issue Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-77022580002529223192019-03-26T21:45:53.246-07:002019-03-26T21:45:53.246-07:00If you are getting that issue bcz when you are add...If you are getting that issue bcz when you are adding a view to index page don't select dropdownlist (SampleDbContext) your issues will be resolved. Anonymoushttps://www.blogger.com/profile/17948475816726655574noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-22013285996729182842019-02-09T02:00:37.173-08:002019-02-09T02:00:37.173-08:00if you are getting output like 12345, means your e...if you are getting output like 12345, means your editortepmlate folder name is not correct. Please update it with EditorTemplatesAnonymoushttps://www.blogger.com/profile/08405875750364014897noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-25911941953635294992017-12-25T21:53:40.345-08:002017-12-25T21:53:40.345-08:00How we handle this if the column has null entries?...How we handle this if the column has null entries?Anonymoushttps://www.blogger.com/profile/05596903062532010787noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-14177305618811643642017-08-10T06:31:00.531-07:002017-08-10T06:31:00.531-07:00Check the view name in EditorsTemplates. It must e...Check the view name in EditorsTemplates. It must equals to model view.Anonymoushttps://www.blogger.com/profile/08051035041430047698noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-71589757223772906122017-07-13T04:01:50.078-07:002017-07-13T04:01:50.078-07:00Check your table entries, IsSelected column should...Check your table entries, IsSelected column should not have null entries.PARANTHAMANSAMhttps://www.blogger.com/profile/07821261903228987849noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-48037996511927717922017-07-13T02:41:05.367-07:002017-07-13T02:41:05.367-07:00I got output as 12345. template is not loaded, I t...I got output as 12345. template is not loaded, I tried<br /> @Html.EditorForModel("City") with parameter. its not working. help me in this.PARANTHAMANSAMhttps://www.blogger.com/profile/07821261903228987849noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-15663517534874143482017-01-28T05:33:03.681-08:002017-01-28T05:33:03.681-08:00I am getting error in this line of code "@Htm...I am getting error in this line of code "@Html.CheckBoxFor(x=>x.IsSelected)".<br />Getting red square line under “x.IsSelected”.<br />i.e<br />"Cannot implicitly convert type 'bool?' to 'bool'. An explicit conversion exists (are you missing a cast?)<br /><br />Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type"<br />Red squire line<br />Adishhttps://www.blogger.com/profile/15798651141108693886noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-65524821491158990832016-09-22T16:32:29.404-07:002016-09-22T16:32:29.404-07:00Hi Venkat,
Could you please let me know how to p...Hi Venkat, <br /><br />Could you please let me know how to post the data back to data base from check box, I know you showed us to to display what checked boxes user check on UI, what if we want to save that data how do we do that, I would really appreciate if you could have something information for me.<br /><br />Thanks<br />AliAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-52077685916872526342016-09-22T00:31:07.470-07:002016-09-22T00:31:07.470-07:00hii venkat i wanna functionality like , if i submi...hii venkat i wanna functionality like , if i submitted the from using Submit button okay , but if some one does back the page using browser then i wanna first time displayed checkboxes. Anonymoushttps://www.blogger.com/profile/08398397159201134680noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-36400429397020963182016-08-30T22:37:17.196-07:002016-08-30T22:37:17.196-07:00i get out 1234 with submit button . after all the...i get out 1234 with submit button . after all the code ?<br />do not get checkbox , is there is any solution for thatshanhttps://www.blogger.com/profile/14883036603279101082noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-42307481283946477932016-07-21T07:08:38.679-07:002016-07-21T07:08:38.679-07:00various way to send selected data to another page,...various way to send selected data to another page, 1- Using FormCollection. 2- Use data model object.Deepak Maddeshiyahttps://www.blogger.com/profile/16725419496739915046noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-47113939667356419292016-07-07T05:17:19.676-07:002016-07-07T05:17:19.676-07:00From where the Cities Property comes in this code ...From where the Cities Property comes in this code and all other parts :-<br /><br />[HttpGet]<br />public ActionResult Index()<br />{<br /> SampleDBContext db = new SampleDBContext();<br /> return View(db.Cities);<br />}Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-80479065785325390242016-01-27T05:24:06.321-08:002016-01-27T05:24:06.321-08:00i am very confused
(1) what happens when we check ...i am very confused<br />(1) what happens when we check the checkbox?<br />(2) how isSelected is updated ?<br />(3) when the form is posted dowe receive all checkboxes or only the selected ones?<br />(4)In foreach loop we are checking <br />if (city.isSelected)<br /> {<br /> sb.Append(city.Name + ", ");<br /> }<br />how isSeleced is updated??????Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-42264873565733636022016-01-18T23:41:48.862-08:002016-01-18T23:41:48.862-08:00how to enter the checkboxlist value to database us...how to enter the checkboxlist value to database using entityframework<br />Anonymoushttps://www.blogger.com/profile/18003352134938356263noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-56481684429271499272016-01-05T21:43:13.761-08:002016-01-05T21:43:13.761-08:00type isselected.value for convert implicity typeto...type isselected.value for convert implicity typeto bool<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-64969017787008878392015-12-26T05:34:34.266-08:002015-12-26T05:34:34.266-08:00You can loop with for in your view. Use IList inst...You can loop with for in your view. Use IList instead of IEnumerableMattehttps://www.blogger.com/profile/14742815877026457433noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-57391015739990732572015-09-08T22:49:27.574-07:002015-09-08T22:49:27.574-07:00Getting an error like con not convert implicitly t...Getting an error like con not convert implicitly the type bool? to bool.Anonymoushttps://www.blogger.com/profile/14371861953198645434noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-83249728326164371792015-06-02T10:18:05.387-07:002015-06-02T10:18:05.387-07:00how to pass collection of model class from view to...how to pass collection of model class from view to controller without using editor templatpe?Sanjeev Duttahttps://www.blogger.com/profile/02097051202071943033noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-21283032829169077442015-01-02T10:04:48.288-08:002015-01-02T10:04:48.288-08:00How to use this helper in Create page?and how to d...How to use this helper in Create page?and how to display what i select item?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-64958671425942113802014-08-06T04:23:52.479-07:002014-08-06T04:23:52.479-07:00How to get the selected data on another page . How to get the selected data on another page . Ravindra K Vermahttps://www.blogger.com/profile/10060145334419327893noreply@blogger.com