473,385 Members | 2,013 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,385 software developers and data experts.

ASP web form guidance.

Hi,

Please excuse me, I am complete ASP novice. I use VB.NET in VS 2003.

I am trying to achieve the following.
Display a list of items, this list needs to be user specific, so my first
question is How do I obtain the user Id of the person? This will run on a
intranet.
Then, based on the option selected, display 1 or more Text Boxes to capture
info. The number of boxes will vary, so Can I add controls to a web form at
run time, as I can in a windows form?
Lastly I will display some program created HTML base on the options entered.
So do I create a temporary HTML page on my server and redirect to it, or if
the HTML is in a string can I display it within a web form?

Sorry, I am a novice, but I have a urgent need, and some initial direction
would be appreciated. I am educating myself through MSDN, but if anyone
knows of more suitable training resource please say.

Regards
Tim

Nov 18 '05 #1
2 1461
Hi Tim,
Thanks for posting in the community!
From your description, you'd like to finish the following operations:
1. Get the client user's id/username in a intranet environment
2. Dynamically add controls
3. Dynamically add a html block on a webform
Also, you are looking for some proper tutorial or guides on ASP.NET, yes?
If there is anything I misunderstood, please feel free to let me know.

As for these questions, here is my suggestions:
1. You can try use the IIS ServerVariables, it contains many clientside
machine's infos, you can get it via the "Request"
object in ASP.NET, for example:
For Each key As String In Request.ServerVariables.Keys
Response.Write(key & ": " & Request.ServerVariables.Item(key))
Next
the above code list out all the ServerVariables. For detailed info on IIS
ServerVariables you may view the follwing reference:
#IIS Server Variables
http://msdn.microsoft.com/library/en...bles.asp?frame
=true

Also, you can try using the "HttpContext.Current.User" member, which
contains the current user's identity info, if you use "Windows"
authentication in ASP.NET, you'll be able to get the clientside user's id
which routered from IIS Server to ASP.NET worker process. For more detailed
info, you may view the following reference in MSDN:
#HttpContext.User Property
http://msdn.microsoft.com/library/en...webhttpcontext
classusertopic.asp?frame=true

2. As for dynamically add sever controls on a web form, you can follow the
guides and samples in MSDN and Knowlegebase, here are the web links to some
tech article:

#Adding Controls to a Web Forms Page Programmatically
http://msdn.microsoft.com/library/en...controlstowebf
ormspageprogrammatically.asp?frame=true

#HOW TO: Dynamically Create Controls in ASP.NET with Visual Basic .NET
http://support.microsoft.com/?id=317515

3. There are two means to dynamically add a html block into a web page.
(1) Using the <%Response.Write( "fdsafdsfdssdf") %> block as in classic
ASP. We can still use such code block in ASP.NET. For detailed info ,please
view the following reference:

#Code Blocks in ASP.NET
http://msdn.microsoft.com/library/en...blocks.asp?fra
me=true

(2). Put some certain ASP.NET ServerControls(such as Literal Control or
Label Control) and set these control's "Text" property to the certain Html
string you want to add. For example
If we have a Literal Control named "ltlHtml"(its id), then in codebehind ,
we can use such code as below to add dynamic html code block:

ltlHtml.Text = "<table width='100%' align='center'
<tr><td></td></tr></table>"


Below is the reference of Literal Web Server Control in MSDN:
#Literal Web Server Control
http://msdn.microsoft.com/library/en...lwebservercont
rol.asp?frame=true

Please check out the above suggestions to see whether they help. Further
more, There're many site provide guides and many live samples on ASP.NET,
here are some:

#ASP.NET professional site:
http://www.asp.net

#GOTDOTNET ASP.NET QUICKSTART
http://samples.gotdotnet.com/quickstart/aspplus/

Hope these also helpful!
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #2
Thanks for the detailed response, I will check out the articles.

Many Thanks
Tim

"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:BY****************@cpmsftngxa06.phx.gbl...
Hi Tim,
Thanks for posting in the community!
From your description, you'd like to finish the following operations:
1. Get the client user's id/username in a intranet environment
2. Dynamically add controls
3. Dynamically add a html block on a webform
Also, you are looking for some proper tutorial or guides on ASP.NET, yes?
If there is anything I misunderstood, please feel free to let me know.

As for these questions, here is my suggestions:
1. You can try use the IIS ServerVariables, it contains many clientside
machine's infos, you can get it via the "Request"
object in ASP.NET, for example:
For Each key As String In Request.ServerVariables.Keys
Response.Write(key & ": " & Request.ServerVariables.Item(key))
Next
the above code list out all the ServerVariables. For detailed info on IIS
ServerVariables you may view the follwing reference:
#IIS Server Variables
http://msdn.microsoft.com/library/en...bles.asp?frame =true

Also, you can try using the "HttpContext.Current.User" member, which
contains the current user's identity info, if you use "Windows"
authentication in ASP.NET, you'll be able to get the clientside user's id
which routered from IIS Server to ASP.NET worker process. For more detailed info, you may view the following reference in MSDN:
#HttpContext.User Property
http://msdn.microsoft.com/library/en...webhttpcontext classusertopic.asp?frame=true

2. As for dynamically add sever controls on a web form, you can follow the
guides and samples in MSDN and Knowlegebase, here are the web links to some tech article:

#Adding Controls to a Web Forms Page Programmatically
http://msdn.microsoft.com/library/en...controlstowebf ormspageprogrammatically.asp?frame=true

#HOW TO: Dynamically Create Controls in ASP.NET with Visual Basic .NET
http://support.microsoft.com/?id=317515

3. There are two means to dynamically add a html block into a web page.
(1) Using the <%Response.Write( "fdsafdsfdssdf") %> block as in classic
ASP. We can still use such code block in ASP.NET. For detailed info ,please view the following reference:

#Code Blocks in ASP.NET
http://msdn.microsoft.com/library/en...blocks.asp?fra me=true

(2). Put some certain ASP.NET ServerControls(such as Literal Control or
Label Control) and set these control's "Text" property to the certain Html
string you want to add. For example
If we have a Literal Control named "ltlHtml"(its id), then in codebehind ,
we can use such code as below to add dynamic html code block:

ltlHtml.Text = "<table width='100%' align='center'
<tr><td></td></tr></table>"
Below is the reference of Literal Web Server Control in MSDN:
#Literal Web Server Control

http://msdn.microsoft.com/library/en...lwebservercont rol.asp?frame=true

Please check out the above suggestions to see whether they help. Further
more, There're many site provide guides and many live samples on ASP.NET,
here are some:

#ASP.NET professional site:
http://www.asp.net

#GOTDOTNET ASP.NET QUICKSTART
http://samples.gotdotnet.com/quickstart/aspplus/

Hope these also helpful!
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

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

Similar topics

2
by: Alan Morris | last post by:
I would like to write a generalised page which creates an email containg the (calling) HTML form complete with the user populated data. In this way the appearance of the email will be just like...
1
by: Orest Kinasevych | last post by:
Okay, I made sense of the earlier suggestions and realized I was on the right track -- I appreciate the feedback which got me to this point. The suggestions posted here indeed worked and...
3
by: Kenny | last post by:
I'm trying to retrieve the data off a form (survey.htm) and email the results back to me using CDO and ASP (survey.asp). I'm confused as to how to retrieve the form data from survey.htm and send...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
4
by: Michael | last post by:
Hi Everyone, I'm hoping someone out there can give me some guidance. I'm currenlty using VS2005 and the other day the Form Wizzard stopped working. What I mean, is that the wizzard no longer...
1
by: Tri_Fecta | last post by:
Newbie to C# - (and yes, VB practitioner) - need to change lable control background color in response to an event but have been unable to find syntax/guidance to do so in code.... i.e. ...
4
by: Macbane | last post by:
Hi, I have a 'main' form called frmIssues which has a subform control (named linkIssuesDrug) containing the subform sfrmLink_Issues_Drugs. A control button on the main form opens a pop-up form...
13
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
3
by: burger54 | last post by:
I have a form, lets call it form A, that displays a list of projects that need completed. The record source for form A is a simple select Query. when you click on a record it shows a detailed...
1
by: sj7272 | last post by:
Hi, I am building email marketing framework, my email templates go out to clients and I wish to include a "send to a friend" or "forward to a friend" link in the outbound email. I want to track...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.