CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 9/11/2007 7:21:19 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 5 Views: 42 Favorited: 0 Favorite
6 Items, 1 Pages 1 |< << Go >> >|
"RDowdall" <>
NewsGroup User
How to access server control on Content page9/11/2007 7:21:19 PM

0

Hello - I have a couple of dropdownlists on my content page and I tried to insert a "Select..." in the page load event on that page. I noticed that the page load event on the content page doesn't get fired. How do I insert an item into the ddl when the page loads?

 

RD

"sswanner1" <>
NewsGroup User
Re: How to access server control on Content page9/11/2007 7:32:13 PM

0

It should...   Put a break on Sub Page_Load() on your content page and debug.  Hopefully that will help you track down your problem.


Mark this post as the "Answer" if it was the answer.
"ajaymgautam" <
NewsGroup User
Re: How to access server control on Content page9/11/2007 9:37:38 PM

0

Even I faced that problem before. Try declaring javascript function on the page, and calling that function after all the control by Registerclientscriptblock or just normal asp:literal control.

 

<script>

function tobecalled(){...}

<asp:dropdown 1

<asp:dropdown 2

 

<asp:literal literal1

 and on code behind write literal1.Text="<script>tobecalled();</script> 

"Johnson2007" <
NewsGroup User
Re: How to access server control on Content page9/12/2007 2:58:11 AM

0

RDowdall:
I noticed that the page load event on the content page doesn't get fired.
 

I am confused, How does this problem come out? Have you tried to find out how this problem is caused? 


Johnson
"ajaymgautam" <
NewsGroup User
Re: How to access server control on Content page9/12/2007 5:51:45 PM

0

you need to give exact code details or some prototype of what you're doing? it could be javascipt error, or small glitch somewhere.
"Amanda Wang -
NewsGroup User
Re: How to access server control on Content page9/13/2007 3:34:28 AM

0

Hi RD,

As  your description, you cannot add items for the dropdownlist in the content page's load event. Is it right?

I have a test, it works fine, below is my test code in the content page codebehind.

public partial class TestDropDownList_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ListItem LI = new ListItem();
        LI.Text = "Selected Item";
        LI.Value = "select";

        this.DropDownList1.Items.Add(LI);
    }
} 

 How about your code?


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
6 Items, 1 Pages 1 |< << Go >> >|


Free Download:













theme not working off the root

working with sitemap

url rewriting, masterpages & insanity

master page with user control causes master page_load to fire twice!

is there a tree node clicked event

enter key postback in asp.net 2.0

how to make a tree view

web.sitemap url problem

have to include .cs file for master page on production environment?

problem with contentplaceholder content format in ie, ok in firefox

navigation panel

global item in multiple web applications projects

customising navigation menu.

.net menu control speed ie6

onload javascript event with a masterpage

master pages and access rights

treemenu and xpath

tree view control checking

how to get web page theme name?

masterpages and user controls

show different content pages based on selction in master page without refreshing

menuitemclick event not being raised

masterpage not rendering properly

how to navigate using treeview postback?

css menu: treeview/bulleted list

sitemap problem

treeview, how to draw hr between nodes?

changing the style of a link within web.sitemap

treeview hide sitemap node...

sitemap and role based access(custom roles)

recompile behavior on master page update

tree view node check

changing the body id rendered in html

dynamic masterpages and themes

submit form in iframe within master page...

master page method: code-behind for content page

can we use user controls in master page ?

2 quesions/issues

treeview errors

asp.net menu control display problem in ie7

dynjamically get contentplaceholderid for a masterpage from another page

treeview doesn't postback on checkedchange

master page and javascript

regarding javascript and validation in content pages

gridview skin

template in aspx

set treenode image in code behind (vb)

how to validate the servercontrols present in content page using javascript

can any one help me how to use tree view

help on using themes

   
  Privacy | Contact Us
All Times Are GMT