473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

creating server controls on the Fly from code behind

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
Nov 19 '05 #1
0 774

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
6
by: Glenn Owens | last post by:
I have an ASP.Net page on which there are serveral static controls (listboxes, radiobuttonlist and textboxes). These controls are used to create criteria from which the code-behind will dynamically...
2
by: RAJ | last post by:
In our multi-tier application, we have several ASP.NET user controls which will update the same data source provided by middle tier logic. In this particular scenario we have one user control...
5
by: RA | last post by:
I have created a button dynamically; which has been added to a TableCell of a TableRow of a Table control. Is there a way to add onclick event which calls a procedure on the Server-side itself....
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
5
by: siaj | last post by:
Hello All, Can any one give me a clue when to use Web Server controls/ HTML server controls/HTML Controls. As I understand .. HTML controls should be used if u dont need to refer it in the code...
7
by: Varangian | last post by:
Hello is creating controls at runtime the same as designtime ? will a page be faster if controls are created at designtime rather than at runtime ? If so why ? thanks :)
0
by: Learner | last post by:
Hello, We use Master Pages in our website and need a page to be created dynamically. I am not sure where I am missing but I don't see any error and the controls on the page either! Here is my...
11
by: gunjan.mait | last post by:
hi, i wanted to know the exact use of runat="server" which is being used is ASP.NET why we every time need to use it, even when i want to do the work at client side? How to do simple processings...
3
by: =?Utf-8?B?WmlhbmdpIEpvbmVz?= | last post by:
Hi, I m using VS .NET 2003 to create a website. Using the setup package I create a setup as well. But this setup has files with actual code in it & not pre-compiled DLLs. Please let me know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.