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