sqlhelp Posted January 31, 2012 Report Posted January 31, 2012 .net MVC pattern lo checkbox create chesaka dani code behind I mean checkbox value ni view ascx page lo ela pass cheydam with an if condition ? controller lo kuda code add cheyala? ex : ila check box create chesanu <input id="Checkbox1" name="copy_abc_xyz" type="checkbox" value="1" /><b>abc xyz</b> </p> dinki controller and view lo checked value ni ela pass cheyali any idea if condition ( checked value = "true" ) { some paragraph should be displayed } else { error } koncham urgent please help... thanks in advance...
CORLEONE Posted January 31, 2012 Report Posted January 31, 2012 galigannarao ani oka ID untundi, PM pettu. he may help you out !
galigannarao Posted January 31, 2012 Report Posted January 31, 2012 oka bool variable teesukoni check box check danni true set chesi controllerki passchesi kummey inka
sqlhelp Posted January 31, 2012 Author Report Posted January 31, 2012 PM chesanu.. reply chestharu ani waiting
tom bhayya Posted January 31, 2012 Report Posted January 31, 2012 <asp:TextBox id="work" runat="server" /> <asp:CheckBox id="check1" Text="check box name" TextAlign="Right" AutoPostBack="True" OnCheckedChanged="Check" runat="server" /> <script runat="server"> Sub Check(sender As Object, e As EventArgs) if check1.Checked then work.Text="what ever is your para" else work.Text="error message" end if End Sub </script>
dennis Posted January 31, 2012 Report Posted January 31, 2012 something like form .getelementbyid("idname") itla untadhi emo
CORLEONE Posted January 31, 2012 Report Posted January 31, 2012 [quote name='sqlhelp' timestamp='1327982724' post='1301362078'] PM chesanu.. reply chestharu ani waiting [/quote] paina already sol kuda cheppesinattu unnadu gaa
sqlhelp Posted January 31, 2012 Author Report Posted January 31, 2012 [quote name='galigannarao' timestamp='1327982710' post='1301362077'] oka bool variable teesukoni check box check danni true set chesi controllerki passchesi kummey inka [/quote] bool variable ni ekada view lo set chesthama or controller method lo na ? ikada inko point added checkbox oka view page lo undi... condition inko view page lo rayali... controller is linked with condition view page..
galigannarao Posted January 31, 2012 Report Posted January 31, 2012 [quote name='sqlhelp' timestamp='1327982964' post='1301362100'] bool variable ni ekada view lo set chesthama or controller method lo na ? [/quote] Modello nuvvu public properties create chestavuga so andulo oka bool property create chesuku. elago nee pagelo class yokka object create chestavuga so checkbox check ayte true set chey aa propertyki lekaote false. then pass that object to controller and use it.
galigannarao Posted January 31, 2012 Report Posted January 31, 2012 [quote name='sqlhelp' timestamp='1327982964' post='1301362100'] bool variable ni ekada view lo set chesthama or controller method lo na ? ikada inko point added checkbox oka view page lo undi... condition inko view page lo rayali... controller is linked with condition view page.. [/quote] adi cheppu mari. i got ur point. aspx page lo user control use chestunnavu antena. then do one thing create a public property in the user control and set the value in the aspx and use that in the ascx.
sqlhelp Posted January 31, 2012 Author Report Posted January 31, 2012 ok thanks a lot try chesthanu ipudu
sqlhelp Posted January 31, 2012 Author Report Posted January 31, 2012 bool value ni ilage na pass chesedhi ? <%if ((bool)ViewData["abc xyz"] == true) { %> paragraph <%} else {%> paragraph I am getting an error saying check if value is 0
Recommended Posts