Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Need help with hidden field problemNeed help with hidden field problem
Previous
 
Next
New Post
7/30/2008 8:35 PM
 

I have a hidden input field in my ascx control:

<input type="hidden" runat="server" id="userEmail" />

and from the code behind, I populate it like this:

 userEmail.Value = this.UserInfo.Email;

When the code is run, here is what my hidden field looks like:

     <input name="dnn$ctr371$DragDropJobs$userEmail" type="hidden" id="dnn_ctr371_DragDropJobs_userEmail" value="me@hotmail.com" />

What is all that bizarre crap in the name and id field? Why did it change from a simple userEmail? How do I fix it?

thanks

Nick

 

 
New Post
7/30/2008 8:48 PM
Accepted Answer 

I figured it out. I created a literal on the webpage:

     <asp:Literal runat="server" ID="litUserEmail"/>

and on the code behind page, populated it like this:

        litUserEmail.Text = "<input type=\"hidden\" id=\"userEmail\" value=\"" + this.UserInfo.Email + "\"/>";

and it's now working.

Nick

 

 
New Post
7/31/2008 3:18 PM
 

When you set a control in Dotnet to runat=server, the .net will code it so it can handle the events.

If you use literals you are not aboe to access much of the server sider controls's features.

 
New Post
7/31/2008 6:04 PM
 

I needed to get the DotNetNuke currently logged in user and expose it to javascript and ajax. I don't need any server side .net access.

thanks

Nick

 

 
New Post
8/6/2008 9:05 AM
 

Unfortunately the server side feature also includes intellisense.

To access control, you would

(1) Declear an object as the control you want.

(2) Set the decleared control to the targeted control (find using find control)

(3) Modify the control

i.e. (accessing an item in gridview)
Dim txtCity As TextBox = CType(row.FindControl("txtCity"), TextBox)

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Need help with hidden field problemNeed help with hidden field problem


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out