PC Review


Reply
Thread Tools Rate Thread

creating server controls on the Fly from code behind

 
 
Ryan Ternier
Guest
Posts: n/a
 
      4th Aug 2005
I'm running through a loop printing out an un-ordered list of Items.

Each Item (when selected through JavaScript) will get highlighted, and 4
images will be shown with it.

Currently their static images because these are simply screens for the
final product.

However, it would be much nicer to have them post back to the server so
i can get the values from them, rather than post to the server and
having to read Querystring and Form values.

Is there a way of doing this without making a mess of the code?

Current Code:

string strJava = "OnMouseOver=\"Highlight(this);\"
OnClick=\"Select(this, '" + r["Number"].ToString().Replace("-","_") +
"');\" onmouseout=\"deHighlight(this);\"";

string strImage = "<img id=\"del" +
r["Number"].ToString().Replace("-","_") + "\" class=\"DItemControls\"
src=\"Images/delete.gif\">";

strImage += "<img id=\"up" + r["Number"].ToString().Replace("-","_") +
"\" class=\"DItemControls\" src=\"Images/navigate_up.gif\">";

strImage += "<img id=\"down" + r["Number"].ToString().Replace("-","_") +
"\" class=\"DItemControls\" src=\"Images/navigate_down.gif\">";

strImage += "<img id=\"view" + r["Number"].ToString().Replace("-","_") +
"\" class=\"DItemControls\" src=\"Images/button_item_view.gif\">";


return "<ul>" + "<li " + strJava + " class=\"Item\" >" +
r["Number"].ToString() + " : " + r["Description"].ToString() + strImage
+ " " + "</li>" + "</ul>\n"

I'd like to do this with 4 functions, where all delete buttons call the
same function, and I grab the Data I need through the sender object.

Any help would be great!

/RT
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Server Controls Jonathan Wood Microsoft ASP .NET 4 17th Feb 2010 03:59 AM
Deleting and creating controls via code John Microsoft Dot NET Framework Forms 1 20th Jun 2007 08:25 PM
Deleting and creating controls via code John Microsoft Dot NET 1 20th Jun 2007 08:25 PM
Deleting and creating controls via code John Microsoft VB .NET 1 20th Jun 2007 07:50 PM
creating controls using code ashishprem Microsoft Excel Programming 1 1st Mar 2006 10:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 PM.