CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/29/2007 7:48:28 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 38 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
kasim
Asp.Net User
Finding a controls inside a FormView which is inside a MasterPage3/29/2007 7:48:28 PM

0/0

Hi,

I have few controls (textboxes) inside a FormView that is inside a MasterPage. The findcontrol doesn't work for me or I'm not doing it right. If I JUST use the FormView or JUST the MasterPage then the findcontrol works. For example TextBox idTextBox = (TextBox)FormView1.FindControl("TextBox1"); works if I don't use the MasterPage.

Can someone please help? How do you find a control inside the FormView1 that is inside the MasterPage?

Any help would be appreciated.

Allen Chen – MS
Asp.Net User
Re: Finding a controls inside a FormView which is inside a MasterPage3/30/2007 7:22:37 AM

0/0

Hi, friend:

  Try this:

        FormViewRow fr = ((FormView)Master.FindControl("FormView1")).Row;
       
            if (fr.FindControl("TextBox1") != null) Response.Write(((TextBox)fr.FindControl("TextBox1")).Text);

Regards


Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

If my solution doesn't solve your problem, just feel free to mark it as not answer and reply.
kasim
Asp.Net User
Re: Finding a controls inside a FormView which is inside a MasterPage3/30/2007 4:53:07 PM

0/0

Thank you Allen.

I tried using your method but for some reason it kept throwing the NullException. Your answer lead me to find the solution a bit differently...here it is if anyone else has the same problem:

Simply use the PreRender method and check which mode you are in...in my case I want to find the control in the Insert mode.

if (FormView1.CurrentMode == FormViewMode.Insert) {

   TextBox test2 = (TextBox)FormView1.FindControl("TextBox1");

   test2.Text = "I found you!";

}

MikeSpeegle
Asp.Net User
Re: Finding a controls inside a FormView which is inside a MasterPage4/2/2007 4:11:20 AM

0/0

You need to make sure that you have the tag that gets added because of your master page.

 

        var imageTagID = "<%= TextBox1.ClientID %>";
        imageTagID = imageTagID.replace(/TextBox1/i,"");

put that as a global then you can use the following syntax:

                var myObject = document.all ? document.all[imageTagID+"TextBox1"] : document.getElementById(imageTagID+"TextBox1");

Which will return your object.

 


 

 

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Finding a controls inside a FormView which is inside a MasterPage ... Finding a controls inside a FormView which is inside a MasterPage. Last post 04- 02-2007 12:11 AM by MikeSpeegle. 3 replies. Sort Posts: ...
formview - accessing and setting controls in formview's edit mode ... I have previously found controls inside MasterPage but this time it is also inside the FormView and I can't seem to know how to do that. ...
Visual Studio Magazine Online | Practical ASP.NET: Using ... May 16, 2008 ... The good news first: Finding a control on a Master Page is easy (assuming that the control isn't inside a FormView, of course). ...
PostBackTrigger for Ajax cannot find FormView Button the FormView & UpdatePanel; anyway it works, even inside of a MasterPage. Any thought's welcome to my better understanding this are welcome? ...
TabStrip & Multipage inside FormView - telerik Forum But after hitting the "update"-button of the FormView, I can only see the TabStrip, but no controls (inside the MultiPage) anymore. ...
p2p.wrox.com Forums - masterpages, contentplaceholder, formview ... Nov 30, 2007 ... NET 2.0 Beginner > masterpages, contentplaceholder, formview, button ... all these controls and button are inside a formview which is inside ...
.NET ASP.NET webcontrols PostBackTrigger for Ajax cannot find ... PostBackTrigger for Ajax cannot find FormView Button - john. 24-Oct-07 07:40:13. Found odd workaround for FormView inside of UpdatePanel, ...
access controls inside formview inside loginview access controls inside formview inside loginview. microsoft.public.dotnet. framework.aspnet. Author. 3 Aug 2006 9:13 PM. wikkiwikkiwaa ...
TheMSsForum.com >> Asp >> access inner formview controls - The ... Just D. Tag: access inner formview controls Tag: 427442. how do I access a textbox control inside a formview? formview.textbox1.text == "hello world"; ...
Mohamed Sharaf's Blog : Inside ASP.NET Master Pages The master page is working as a container for the controls inside it. If you examined the trace output of this page, you will find something like ...




Search This Site:










issue with sqlsitemap provider

how to resize t.gif, l.gif, i.gif... in treeview

sqlmembershipprovider

form behind code

dnnstore 3.2 released!

released: child pages lister module for dnn3 v001.000

report your bugs 1.0

visual studio 2005 web deployment project - unique version for each dll

filter after create user

zip file broken...no directory structure

v2 blog?

disable skin file for a control

beta 1 and december ctp

help - combined windows and forms based authentication

events will not allow edit

asp to asp.net html code size increase

what to use instead of ms_positioning="flowlayout"

treeview control - output doesnt appear as treeview

user control's class?

master page load

recommended "source safe" type application for remote dnn developers

possible bug in login control ?

managing users created with createuserwizard

how do i stop windows admin user group from automatically adding users with admin priveleges?

custom authenication

parser error - gridview control

module updates at house of nuke

anyone done cookieless with dnn 3.*

nested master page web control not declared isses

ie webcontrol, tool tip for every node in the treeview

 
All Times Are GMT