Click here to Skip to main content
15,908,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
for (int i = 0; i < InsCarr.Count; i++)
                     {
                         mydata += InsCarr[i].InsCarrierName +"<div><br></div>";
                     }



Please tell about how to pass the DIV tag to C#?
following this way is possible to C#?
"<div><br></div>"

If I used the given way, I got the result is below...


peacock<div><br></div>cdfasdf<div><br></div>asdfsdf<div><br></div>f<div><br></div>animal<div><br></div>bad<div><br></div>sdf<div><br></div>df<div><br></div>dfg<div><br></div>

but, I need the result to be...

cdfasdf
peacock
animal
bad
Posted
Updated 14-Oct-10 21:30pm
v4
Comments
Dalek Dave 15-Oct-10 3:31am    
Edited for Grammar and Spelling.

must be insert div tag and set two important properties runat and id
such as:
<div id="div1" runat="server" />
or use panel
<asp:panel id="pnl1" runat="server"/>
 
Share this answer
 
v2
Comments
raju melveetilpurayil 19-Oct-10 7:52am    
you are right
This problem is solved.
tag is placed to infront of Loop...

the correct code below...


XML
Response.Write("<div style='position:absolute; background-color:#D1FFFF ; width:150px; height:150px;'>");   

                        for (int i = 0; i < InsCarr.Count; i++)
                        {
                            mydata = InsCarr[i].InsCarrierName;  // +"<div><br></div>";
                            if (ReturnTextbox != null && ReturnTextbox.Trim().Length > 0)
                            {
                                //Write to default page, with selection options.
                                if (MyDiv == null || MyDiv.Trim().Length == 0)
                                {
                                    Response.Write("<div onmouseover=\"this.style.cursor='pointer';\"" +
                                        "onmouseout=\"this.style.cursor='pointer';\"" +
                                        "onclick=\"SetTextbox('" +
                                        ReturnTextbox.Trim() + "','" +
                                        mydata + "', '');\">" +
                                        "<font size='2' face='Tahoma'><B>");

                                }
                                else
                                {
                                    Response.Write("<div onmouseover=\"this.style.cursor='pointer'; \"" +
                                          "onmouseout=\"this.style.cursor='pointer';\"" +
                                          "onclick=\"SetTextbox('" +
                                          ReturnTextbox.Trim() + "','" +
                                          mydata + "', '" +
                                          MyDiv + "');\">" +
                                          "<font size='2' face='Tahoma'><B>" + mydata + "</B></font>" +
                                          "</div>");
                                }
                            }
                            else
                            {
                                Response.Write("<div><font size='2' face='Tahoma'><B>" +
                                    mydata + "</B></font></div>");
                            }
                        }
                        Response.Write("</div>");

                    }
                    else
                    {
                        return;
                    }
 
Share this answer
 
v4
Comments
Dalek Dave 19-Oct-10 3:17am    
Good Call.
hi ClassCoder...

thankx for your reply..

i followed your code. but, it is not set to TextControl.

i below in my code..

XML
for (int i = 0; i < InsCarr.Count; i++)
                      {
                          mydata += InsCarr[i].InsCarrierName +"<div id='div1' runat='server'><br></div>";
                      }



Also,

VB
Response.Write("<div onmouseover=\"this.style.position='absolute';this.style.cursor='pointer'; \"  " +
                                    "onmouseout=\"this.style.cursor='pointer';\"" +
                                    "onclick=\"SetTextbox('" +
                                    ReturnTextbox.Trim() + "','" +
                                    mydata + "', '');\">" +
                                    "<font size='2' face='Tahoma'><B>" +
                                    mydata +
                                    "</B></font>" +
                                    "</div>")

;

mydata is textbox value....

but, it is not set to textbox.
 
Share this answer
 

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