I have a C# application that builds dynamic HTML and renders it. Because it
is rendered in this way, the input controls are not server controls. I write
the entire page, which has a variable number of detail lines for an order. I
want the user to be able to change values on these detail lines and hit an
'update' button. I know how to do this in Javascript, but I'd like to be
able to inspect the controls that come back to my C# program during a
Postback. Since these are not server controls, they are not available in
Page.Controls. What is the 'proper' way to inspect these inside of the
compiled C# program? Right now I'm parsing them out through javascript, and
passing them through cookies, but there has to be a better way than this,
isn't there? 5 2084
Hi Brian,
Do you have Visual Studio.Net? If so, three are oodles of ways to inspect
process and data in your app, using BreakPoints, Watches, etc.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:C5******** *************** ***********@mic rosoft.com... I have a C# application that builds dynamic HTML and renders it. Because it is rendered in this way, the input controls are not server controls. I write the entire page, which has a variable number of detail lines for an order. I want the user to be able to change values on these detail lines and hit an 'update' button. I know how to do this in Javascript, but I'd like to be able to inspect the controls that come back to my C# program during a Postback. Since these are not server controls, they are not available in Page.Controls. What is the 'proper' way to inspect these inside of the compiled C# program? Right now I'm parsing them out through javascript, and passing them through cookies, but there has to be a better way than this, isn't there?
Yes, running .NET, but what I meant was I needed to get the value of the
controls in my C# program. Programatically I need to check the value of the
controls. I can't figure out how to do it through any normal object.
"Kevin Spencer" wrote: Hi Brian,
Do you have Visual Studio.Net? If so, three are oodles of ways to inspect process and data in your app, using BreakPoints, Watches, etc.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message news:C5******** *************** ***********@mic rosoft.com...I have a C# application that builds dynamic HTML and renders it. Because it is rendered in this way, the input controls are not server controls. I write the entire page, which has a variable number of detail lines for an order. I want the user to be able to change values on these detail lines and hit an 'update' button. I know how to do this in Javascript, but I'd like to be able to inspect the controls that come back to my C# program during a Postback. Since these are not server controls, they are not available in Page.Controls. What is the 'proper' way to inspect these inside of the compiled C# program? Right now I'm parsing them out through javascript, and passing them through cookies, but there has to be a better way than this, isn't there?
When you say "running .Net," are you referring to the .Net platform, or, as
I asked, Visual Studio.Net?
In any case, the question is moot, since you want to do it programmaticall y.
Your best bet is to use WebControls or HtmlControls to do this. That is what
they are designed for. Any other solution is going to be problematic.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:30******** *************** ***********@mic rosoft.com... Yes, running .NET, but what I meant was I needed to get the value of the controls in my C# program. Programatically I need to check the value of the controls. I can't figure out how to do it through any normal object.
"Kevin Spencer" wrote:
Hi Brian,
Do you have Visual Studio.Net? If so, three are oodles of ways to inspect process and data in your app, using BreakPoints, Watches, etc.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message news:C5******** *************** ***********@mic rosoft.com... >I have a C# application that builds dynamic HTML and renders it. >Because >it > is rendered in this way, the input controls are not server controls. I > write > the entire page, which has a variable number of detail lines for an > order. > I > want the user to be able to change values on these detail lines and hit > an > 'update' button. I know how to do this in Javascript, but I'd like to > be > able to inspect the controls that come back to my C# program during a > Postback. Since these are not server controls, they are not available > in > Page.Controls. What is the 'proper' way to inspect these inside of the > compiled C# program? Right now I'm parsing them out through > javascript, > and > passing them through cookies, but there has to be a better way than > this, > isn't there?
Maybe I'm approaching this wrong then. My end result is to have a web page
that shows a variable number of 'detail' lines. These are pulled from a
database. I put a server control on my page that internally renders the
HTML. It builds the entire page dynamically, since the # of detail lines is
not know until the actual order is pulled up. I have checkboxes on each of
the detail lines, so that a user can check a line, and click a button to see
more detail for that line.
The problem is, that since the entire page was built with dynamic HTML, I'm
having trouble finding out which line is checked. Currently, I have a couple
of lines of java script that determine which line is checked, put the value
in a cookie, and pass that to my C# program. It just seems to me that there
should be a way in my C# program to figure out which lines are checked.
Since this whole page is built dynamically, I don't have web controls or html
controls. Any ideas?
"Kevin Spencer" wrote: When you say "running .Net," are you referring to the .Net platform, or, as I asked, Visual Studio.Net?
In any case, the question is moot, since you want to do it programmaticall y. Your best bet is to use WebControls or HtmlControls to do this. That is what they are designed for. Any other solution is going to be problematic.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message news:30******** *************** ***********@mic rosoft.com... Yes, running .NET, but what I meant was I needed to get the value of the controls in my C# program. Programatically I need to check the value of the controls. I can't figure out how to do it through any normal object.
"Kevin Spencer" wrote:
Hi Brian,
Do you have Visual Studio.Net? If so, three are oodles of ways to inspect process and data in your app, using BreakPoints, Watches, etc.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message news:C5******** *************** ***********@mic rosoft.com... >I have a C# application that builds dynamic HTML and renders it. >Because >it > is rendered in this way, the input controls are not server controls. I > write > the entire page, which has a variable number of detail lines for an > order. > I > want the user to be able to change values on these detail lines and hit > an > 'update' button. I know how to do this in Javascript, but I'd like to > be > able to inspect the controls that come back to my C# program during a > Postback. Since these are not server controls, they are not available > in > Page.Controls. What is the 'proper' way to inspect these inside of the > compiled C# program? Right now I'm parsing them out through > javascript, > and > passing them through cookies, but there has to be a better way than > this, > isn't there?
Hi Brian,
Okay, you say you "put a server control on my page that internally renders
the HTML." And "It just seems to me that there should be a way in my C#
program to figure out which lines are checked." Finally, you also mention
that you "have a couple of lines of java script that determine which line is
checked, put the value in a cookie, and pass that to my C# program." In
fact, you HAVE figured out a way in your program to figure out which lines
are checked.
Perhaps you are misunderstandin g ASP.Net a bit, but you certainly know how
to solve a problem! And that is what a programmer (and a program) does. Let
me see if I can clear it up a bit for you and give you a better day.
ASP.Net is all about HTML and HTTP. What the server-side part of the app
does is to create HTML and respond to browser requests, in essence. In other
words, ASP.Net is about working in a stateless HTTP environment in which the
client is disconnected from the server, and HTML is the UI "language" if you
will. HTTP is all about messaging, sending messages back and forth between
the browser and the server.
So, in fact, an ASP.Net application has both a server-side and a client-side
aspect to it. The fact that the server-side code renders the client-side
HTML may be confusing you, but in fact, both are inseparable (although
separate) parts of the same application.
The built-in Microsoft Server Controls, as well as any custom Server
Controls you may create and/or use, do essentially what your solution does.
The only diffrence is in the methodology, and even that is similar. MS
Server Controls render both HTML and JavaScript, as JavaScript is almost the
only way to create a process on the client, in the browser. Server Controls
handle client-side events by creating and using JavaScript and hidden form
fields. The JavaScript on the client is wired up to client-side form
elements via JavaScript event handlers. When a button is clicked, for
example, a JavaScript event handler is fired that puts the ID of the button
into one hidden form field, and an "argument" or a set of arguments, if any,
into another. It then posts the form, which sends the form data, including
the event data, back to the server, where the server-side code reacts to it.
Your solution is proprietary, and doesn't follow the ASP.Net programming
model very closely, but it does essentially what the ASP.Net programming
model does. The ASP.Net programming model is more extensible, and follows a
design pattern that is extremely well thought-out. You may want to follow it
more closely in the future, but that is really of secondary importance to
solving the problem, which you have done quite well.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message
news:08******** *************** ***********@mic rosoft.com... Maybe I'm approaching this wrong then. My end result is to have a web page that shows a variable number of 'detail' lines. These are pulled from a database. I put a server control on my page that internally renders the HTML. It builds the entire page dynamically, since the # of detail lines is not know until the actual order is pulled up. I have checkboxes on each of the detail lines, so that a user can check a line, and click a button to see more detail for that line.
The problem is, that since the entire page was built with dynamic HTML, I'm having trouble finding out which line is checked. Currently, I have a couple of lines of java script that determine which line is checked, put the value in a cookie, and pass that to my C# program. It just seems to me that there should be a way in my C# program to figure out which lines are checked. Since this whole page is built dynamically, I don't have web controls or html controls. Any ideas?
"Kevin Spencer" wrote:
When you say "running .Net," are you referring to the .Net platform, or, as I asked, Visual Studio.Net?
In any case, the question is moot, since you want to do it programmaticall y. Your best bet is to use WebControls or HtmlControls to do this. That is what they are designed for. Any other solution is going to be problematic.
-- HTH,
Kevin Spencer Microsoft MVP ..Net Developer Sometimes you eat the elephant. Sometimes the elephant eats you.
"Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message news:30******** *************** ***********@mic rosoft.com... > Yes, running .NET, but what I meant was I needed to get the value of > the > controls in my C# program. Programatically I need to check the value > of > the > controls. I can't figure out how to do it through any normal object. > > "Kevin Spencer" wrote: > >> Hi Brian, >> >> Do you have Visual Studio.Net? If so, three are oodles of ways to >> inspect >> process and data in your app, using BreakPoints, Watches, etc. >> >> -- >> HTH, >> >> Kevin Spencer >> Microsoft MVP >> ..Net Developer >> Sometimes you eat the elephant. >> Sometimes the elephant eats you. >> >> "Brian Kitt" <Br*******@disc ussions.microso ft.com> wrote in message >> news:C5******** *************** ***********@mic rosoft.com... >> >I have a C# application that builds dynamic HTML and renders it. >> >Because >> >it >> > is rendered in this way, the input controls are not server controls. >> > I >> > write >> > the entire page, which has a variable number of detail lines for an >> > order. >> > I >> > want the user to be able to change values on these detail lines and >> > hit >> > an >> > 'update' button. I know how to do this in Javascript, but I'd like >> > to >> > be >> > able to inspect the controls that come back to my C# program during >> > a >> > Postback. Since these are not server controls, they are not >> > available >> > in >> > Page.Controls. What is the 'proper' way to inspect these inside of >> > the >> > compiled C# program? Right now I'm parsing them out through >> > javascript, >> > and >> > passing them through cookies, but there has to be a better way than >> > this, >> > isn't there? >> >> >> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Hari |
last post by:
What is the difference between HTML controls, HTML server
controls , ASP.Net controls?
Which will give more performance?
|
by: brian |
last post by:
What are the advantages and disadvantages of using HTML Server Controls over
Web Server Controls and vice versa? Is there a clear cut consensus among
ASP.NET developers over which controls to use?
Thanks
|
by: Alan Silver |
last post by:
Hello,
ASP.NET newbie here so please be nice ;-)
I'm reading ASP.NET Unleashed, following a recommendation here. I am a
little confused about the difference between HTML controls and web
controls. Obviously there are web controls that don't have any relation
to HTML controls (like the calendar), but the basic web controls that
produce links, labels, etc seem to do the same as the HTML controls (or
vice-versa).
|
by: Daniel Groh |
last post by:
Hi, I'm newbie to ASP.Net and I'd like to know the best way and when shoul I
use WebControls and HTML Controls, what is the difference ?
I'm developing a login system but i don't know if i use the textfield (HTML
Controls) or textbox (WebControls). What's the difference ?
I hope you can help me!
Thanks a lot!
|
by: Marcus |
last post by:
I have a problem maybe one of you could help me with. I've created a data
entry screen with lots of dynamically-created client-side controls. I
create HTML texboxes client-side by assigning a value to the td.innerHTML
property. The UI is done, and I now want to post back the user's changes
and update my business object in .NET. But when I postback, I can't see any
of my dynamically created HTML controls in VB .NET. How do I make them...
| |
by: Adam Knight |
last post by:
Just out of interest, what is everbody's thought on using HTML Controls Vs
Web Controls.
Any preferences??
Cheers,
Adam
|
by: Chris Davoli |
last post by:
Another front end guy that I work with wants to use old HTML controls instead
of the new .NET server controls. Since he is a old HTML and classic asp
person and is familiar with this, he wants to the old HTML controls instead
of the new .Net controls on a .Net web page. Please give me some opinions on
this. What are disadvantages or advantages, if any?
PS - I only use the new .Net controls. Never have used the old control
except for the...
|
by: Raj Dhrolia |
last post by:
Hi Everyone,
I have some HTML snippets (with about 15 HTML controls) that needs to be
embedded into my server control. I need these HTML controls on client side
for some processing (JS).
What is the best way to implement this?
One most straight forward way i can think of is to have something like -
Response.Write("<long HTML string>");
|
by: bradwoody |
last post by:
ASP.Net and C#
I am having trouble determining how to manipulate html controls via javascript AND access those same controls in the C# code behind. Here's the scoop:
I am making an advanced search page, consisting of a table where each row has (in this order):
- checkbox – to indicate whether to return the column
- label
- textbox – to enter search criteria
On some rows, though, I replaced the textbox with radio buttons so...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |