Custom Web Component Positioning

M

MattC

I have Created a custom component:

Problem is when i drag it onto my aspx page in design mode and position it
where i want the output it doesn't appear there when i run the page. How
can i have the buttons i'm adding to th epage appears where i drag my
component in deisgn mode?

Thanks

below is the render method.


protected override void Render(HtmlTextWriter output)
{
Literal area = new Literal();
StringBuilder sb = new StringBuilder();
SqlConnection theDB = new
SqlConnection(ConfigurationSettings.AppSettings["dbconn"]);
SqlCommand theCom = new SqlCommand("GetExtendedCharacters", theDB);
theDB.Open();
theCom.CommandType = CommandType.StoredProcedure;
SqlDataReader myReader = theCom.ExecuteReader();
while(myReader.Read())
{
sb.Append("<INPUT class=specialbuttonstyle
onClick=\"javascript:ExChar('" + myReader
["ExtendedCharacter"].ToString() + "');\" + type=\"button\" value=\"" +
myReader["ExtendedCharacter"].ToString() + "\"><br>");
}
myReader.Close();
theDB.Close();
area.Text = sb.ToString();
String insertandfocus = "insertandfocus.js";
Page.RegisterClientScriptBlock("InsertAndFocus", insertandfocus);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top