hi all,
how can I populate one aspx form when page is loading based on page ID? for
example:
loading page A (to search for VB code) would display labels and texboxes,
dropdown lists all related to VB, plus the address bar would show something
like this: www.somethinghere?id=3
and if you change number 3 from the address bar to (for example) 34 or 71
you would get different page with the same formatting like I.e: www.somethinghere?id=34 would load the page related to C# topics and all
labels and texboxes and dropdown lists related to C# OR www.somethinghere?id=71 would load the page related to ASP.NET for example
and labels and textboxes would be populated according to ASP.NET and so
on...
my question is, how do they do that? they must assign an ID number for each
topic but then how they populate all controls on that ONE page accordingly?
I am very much interested in this approach and wants to know how its done
and how can I get more info about it. I think its better than duplicating
pages if you were going to use them over and over?
what do you think?
please let me know
thanks 9 7012
id=XX part of the url is available as Request.QueryString.
Request.QueryString["id"] for www.somethinghere?id=71 will return "71".
PageLoad event code can read the id and setup the page controls accordingly.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"netasp" <ne****@newsgroups.nospamwrote in message
news:O6**************@TK2MSFTNGP02.phx.gbl...
hi all,
how can I populate one aspx form when page is loading based on page ID?
for example:
loading page A (to search for VB code) would display labels and texboxes,
dropdown lists all related to VB, plus the address bar would show
something like this: www.somethinghere?id=3
and if you change number 3 from the address bar to (for example) 34 or 71
you would get different page with the same formatting like I.e: www.somethinghere?id=34 would load the page related to C# topics and all
labels and texboxes and dropdown lists related to C# OR www.somethinghere?id=71 would load the page related to ASP.NET for example
and labels and textboxes would be populated according to ASP.NET and so
on...
my question is, how do they do that? they must assign an ID number for
each topic but then how they populate all controls on that ONE page
accordingly?
I am very much interested in this approach and wants to know how its done
and how can I get more info about it. I think its better than duplicating
pages if you were going to use them over and over?
what do you think?
please let me know
thanks
thanks Eliyahu for your reply,
does this method considered to be a good or bad practice with visual studio
2005? because I also have seen some other web applications using different
pages for each category page, their address bar would show aspx pages I.e
employee.aspx, manager.aspx, supervisor.aspx instead of loading everything
into one template page.
I just want to know what is the best practice and recommendation for such a
scenario?
thanks again
"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:%2****************@TK2MSFTNGP03.phx.gbl...
id=XX part of the url is available as Request.QueryString.
Request.QueryString["id"] for www.somethinghere?id=71 will return "71".
PageLoad event code can read the id and setup the page controls
accordingly.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"netasp" <ne****@newsgroups.nospamwrote in message
news:O6**************@TK2MSFTNGP02.phx.gbl...
>hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related to VB, plus the address bar would show something like this: www.somethinghere?id=3
and if you change number 3 from the address bar to (for example) 34 or 71 you would get different page with the same formatting like I.e: www.somethinghere?id=34 would load the page related to C# topics and all labels and texboxes and dropdown lists related to C# OR www.somethinghere?id=71 would load the page related to ASP.NET for example and labels and textboxes would be populated according to ASP.NET and so on...
my question is, how do they do that? they must assign an ID number for each topic but then how they populate all controls on that ONE page accordingly?
I am very much interested in this approach and wants to know how its done and how can I get more info about it. I think its better than duplicating pages if you were going to use them over and over?
what do you think?
please let me know
thanks
Hello Netasp,
In ASP.NET, dynamically creating webcontrols is naturally supported. Here
are some web articles introducing this:
#HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET http://support.microsoft.com/kb/317794/EN-US/
#Adding Controls to a Web Forms Page Programmatically http://authors.aspalliance.com/aspxt...ingcontrolstow
ebformspageprogrammatically.aspx
#How to: Add Controls to an ASP.NET Web Page Programmatically http://msdn2.microsoft.com/en-us/library/kyt0fzt1.aspx
for your scenario, you want to generate two page UI for different client
user requests(search for VB or c#), I think you need to consider the
following things:
Which one is more important for our application, flexibiilty or
performance?
When we dynamically create the page UI depend on different client requests,
it make the page very flexible and easy to extend when you want to add
additional UI template(such as search for J#...). However, the drawback
here is that dynamically creating control will add performance overhead
which is less efficient than statically compiled and loaded page/controls.
Also, making the page UI dynamically generated will make the line of code
in your page increase significantly.
IMO, for those pages which as definitely different code logic and business
purpose or the UI differ from each other obviously, I would recommend you
create separate page for each one.
If the UI of those pages are similar and easy to be templated, you can
consider creating a page to dynamically generate UI.
Please feel free to let me know if you have any further questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
thank you Steven for your reply,
how about this:
I create the page and add all the necessary controls to it, dropdown list,
an image box, labels and some textboxes (with generic names) -// so there is
not an overhead of creating controls dynamically
then, if the user clicks the ASP.NET link for example (and lets say it has
been assigned ID=1) then I go to my database and load the appropriate
control names and images for the C# page! OR if the user clicks C# link
(which lets also assume it has been assigned to ID=21) then I will load from
another table all the appropriate names for labels, textboxes and images for
that C# page.
what do you think? would that cut half of my overhead expenses? considering
the controls are already been created?
I would love to hear your input on this approach.
thank you very much for the links
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:hp**************@TK2MSFTNGXA01.phx.gbl...
Hello Netasp,
In ASP.NET, dynamically creating webcontrols is naturally supported. Here
are some web articles introducing this:
#HOW TO: Dynamically Create Controls in ASP.NET by Using Visual C# .NET http://support.microsoft.com/kb/317794/EN-US/
#Adding Controls to a Web Forms Page Programmatically http://authors.aspalliance.com/aspxt...ingcontrolstow
ebformspageprogrammatically.aspx
#How to: Add Controls to an ASP.NET Web Page Programmatically http://msdn2.microsoft.com/en-us/library/kyt0fzt1.aspx
for your scenario, you want to generate two page UI for different client
user requests(search for VB or c#), I think you need to consider the
following things:
Which one is more important for our application, flexibiilty or
performance?
When we dynamically create the page UI depend on different client
requests,
it make the page very flexible and easy to extend when you want to add
additional UI template(such as search for J#...). However, the drawback
here is that dynamically creating control will add performance overhead
which is less efficient than statically compiled and loaded page/controls.
Also, making the page UI dynamically generated will make the line of code
in your page increase significantly.
IMO, for those pages which as definitely different code logic and business
purpose or the UI differ from each other obviously, I would recommend you
create separate page for each one.
If the UI of those pages are similar and easy to be templated, you can
consider creating a page to dynamically generate UI.
Please feel free to let me know if you have any further questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
Thanks for your reply Netasp,
As for the new idea you mentioned, do you mean you predefine all the
controls on the page and assigned fixed ID for each one. and dynamically
load their string resources( such as Text ....) from file or database and
assign to their "Text" property? If this is the case, I think it doable.
Of course, if the controls are defined at design-time, it will save lots of
dynamic control creating and loading overhead.
Please let me know if you have any further questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
thanks Steven for your reply,
yeah, this is very much the idea, and I think its better than creating more
than one aspx page that does exactly the same thing.
it seems doable so far, and I will pick up any issues as I advance.
thanks for your help.
best regard,
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:9Q**************@TK2MSFTNGXA01.phx.gbl...
Thanks for your reply Netasp,
As for the new idea you mentioned, do you mean you predefine all the
controls on the page and assigned fixed ID for each one. and dynamically
load their string resources( such as Text ....) from file or database and
assign to their "Text" property? If this is the case, I think it doable.
Of course, if the controls are defined at design-time, it will save lots
of
dynamic control creating and loading overhead.
Please let me know if you have any further questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
Thanks for the followup Netasp,
Yes, this is a good idea. Actually, what you do is just how ASP.NET
application do localization support for web pages. ASP.NET support creating
resource files for each page or the whole application and we can load
string or other resource(like image, files) from resource file according
different CultureInfo. So for your case here, instead of depending on
CultureInfo, your page's resource are depend on other criteria.
Please feel free to post here if you meet any further problem.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
now I have one final question,
what is the best reliable way of loading a control value from a database?
lets say I have label1 already sitting in my webform how can I load its
content "Books" from a table1 in sql 2005 database?
do I use a normal adapter to loop through? is there a good examples
illustrating how to accomplish that?
thanks
"netasp" <ne****@newsgroups.nospamwrote in message
news:%2***************@TK2MSFTNGP02.phx.gbl...
thanks Steven for your reply,
yeah, this is very much the idea, and I think its better than creating
more than one aspx page that does exactly the same thing.
it seems doable so far, and I will pick up any issues as I advance.
thanks for your help.
best regard,
"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:9Q**************@TK2MSFTNGXA01.phx.gbl...
>Thanks for your reply Netasp,
As for the new idea you mentioned, do you mean you predefine all the controls on the page and assigned fixed ID for each one. and dynamically load their string resources( such as Text ....) from file or database and assign to their "Text" property? If this is the case, I think it doable.
Of course, if the controls are defined at design-time, it will save lots of dynamic control creating and loading overhead.
Please let me know if you have any further questions.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Hi Netasp,
how you'll read the static data from database depend on how will you use
them. If you will only load them at each page's startup time and will
requrey database if require them later, I suggest you use Sqlcommand +
DataReader to query the data since this will have better performance.
If you will load the data and also cached them in local memory for later
use, you can consider use TableAdpater and return them in the form of
DataTable, Dataset ....
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Janus |
last post by:
Hello.
I need a little advice for populating the treeview control.
I dont want my application to hang while populating the treeview, there is a lot of data what's the best approach?
Maybe...
|
by: Tim T |
last post by:
Hi,
I have the need to use dynamically loaded user controls in a webform page.
I have the controls loading dynamically, and that part works fine. this is
the code used in a webform to dynamically...
|
by: Donald Xie |
last post by:
Hi,
I noticed an interesting effect when working with controls that are
dynamically loaded. For instance, on a web form with a PlaceHolder control
named ImageHolder, I dynamically add an image...
|
by: Kamal Jeet Singh |
last post by:
Hi Friends !!
I am have facing problem in controlling the dynamically created
controls on web page. The problem Scenario is
Scenario:- My requirement is to load the web user controls on the...
|
by: Kamal Jeet Singh |
last post by:
Hi Friends !!
I am facing problem in controlling the dynamically created
controls on web page. The problem Scenario is
Scenario:- My requirement is to load the web user controls on the web...
|
by: Wim |
last post by:
Hi Everyone,
I'm trying to speed up a Asp.net 1.1 applications' performance. The
application needs to run in an environment with little bandwith and
therefore pagesizes and roundtrip times shoud...
|
by: |
last post by:
Trying to learn about manipulating collections of objects, and populating
these objects dynamically from datasources. Could someone post a code sample
that shows the following:
Instantiating a...
|
by: Joe |
last post by:
Hello All:
I am trying to dynamically populate a web page with literal content and
controls (textboxes and checkboxes (and eventually two buttons - the buttons
do not appear in the code yet). I...
|
by: TB |
last post by:
Hi All:
I have this page where a rows / cells are programmatically added to to
table by pushing a button.
The rows contain a textbox and a associated button. What I want to is
to be able to...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |