473,758 Members | 7,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1473
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.ServerV ariables.Keys
Response.Write( key & ": " & Request.ServerV ariables.Item(k ey))
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.Cu rrent.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.Us er 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 Programmaticall y
http://msdn.microsoft.com/library/en...controlstowebf
ormspageprogram matically.asp?f rame=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.Writ e( "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"(i ts 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=t rue

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.m icrosoft.com> wrote in message
news:BY******** ********@cpmsft ngxa06.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.ServerV ariables.Keys
Response.Write( key & ": " & Request.ServerV ariables.Item(k ey))
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.Cu rrent.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.Us er 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 Programmaticall y
http://msdn.microsoft.com/library/en...controlstowebf ormspageprogram matically.asp?f rame=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.Writ e( "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"(i ts 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=t rue

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
2346
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 the form elements of the form that called the generalised page together with the completed fields. I can see that I can caputure the (blank) calling page itself in the email by using the CreateMHTMLBody method of CDO. I can also see how I
1
4309
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 eliminated the JavaScript errors I was seeing. The fact that the target URL didn't execute was because certain variables weren't being passed to it. What I need to do is to pass a conditional variable to the target URL, when the form is submitted,...
3
3032
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 it using survey.asp. Below is a sample ASP script that I found on ASPFAQ.com and it works fine, but now how do I grab the info from a form and incorporate it into the emal. Thanks. Appreciate any help or guidance. Kenny <%
25
10262
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
4
1690
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 creates the code in the "Windows Form Designer generated code" section. As a matter a fact, if I add a new form to the project, that section is not even there. The only code that you will see is: Public Class Form2 End Class
1
3187
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. private void label82_Click(object sender, EventArgs e) { }
4
8850
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 which allows me to edit the record in the subform. What I want to happen is for subform with the new edits to be updated on the main form when I close the popup. I'm sure this is a very small bit of code in the the 'On close' event for the popup...
13
3251
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 in procedures via a log in table within the database. This works fine. I have now expanded this table to include further data about the authorised user – Power User, Team Leader, & Facilitator. Depending on the user’s status as to which one of...
3
6053
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 description of the task in a new form, lets call it form B. Form A stays open in the background while form b is open. There is a button on form B which marks the task as completed, which is a yes/no box in the source table. this button also closes form...
1
3130
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 the numbers that take this option, which is no problem, I would just like some guidance on the php mail component of the scripting as I can grab code snippets for the web landing page form. Any guidance appreciated. Thx, Simon
0
10090
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, 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...
0
9924
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9892
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,...
0
9758
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8759
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7310
isladogs
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...
0
5343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3423
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2719
bsmnconsultancy
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...

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.