Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Need help with hidden field problem
Previous Previous
 
Next Next
New Post 7/30/2008 6:35 PM
Resolved
User is offline nickfox
63 posts
10th Ranked


Need help with hidden field problem 

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 6:48 PM
Accepted Answer 
User is offline nickfox
63 posts
10th Ranked


Re: Need help with hidden field problem 

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 1:18 PM
User is offline Johnny Li
87 posts
10th Ranked


Re: Need help with hidden field problem 

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 4:04 PM
User is offline nickfox
63 posts
10th Ranked


Re: Need help with hidden field problem 

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 7:05 AM
User is offline Johnny Li
87 posts
10th Ranked


Re: Need help with hidden field problem 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Need help with hidden field problem
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DNN Photo Gallery
Complete Photo Gallery Management!
www.dnnPhotoGallery.com
R2i - Delivering Serious DNN Services & Solutions
Award Winning Design, Skin construction, Custom Modules and Consulting Services for the Enterprise organization. R2i is the DNN:Map module Project Lead and one of the largest DNN service providers with offices in New York City, Virginia and Baltimore.
www.bi4ce.com
"SalarO" Skinning Graphic Design Branding Services
SalarO develops packaged & custom skins for your DNN at prices you can afford. SalarO is also developing Module development, Hosting, Branding/Logo design as well as Content Transfer Services to complement the core skinning solutions.
www.salaro.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP