Showing posts with label header. Show all posts
Showing posts with label header. Show all posts

Wednesday, March 28, 2012

Difference betwwen CTP and beta 1 with GetPostBackEventReference

Hello,

Last week I have create a page with a gridview with textbox in the header row create dynamically.

For each textbox, I had this code in the creating code :

PostBackOptions postBackOptions =new PostBackOptions(oTextBox);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));

With this code, when I make a keyup in a textbox, the gridview is refresh in "Ajax mode" but now, with the Beta 1, the entire page is postaback.

Can you know why ?

PostBackOptions postBackOptions =new PostBackOptions(oGridView);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));


hello,

can you show us the code that is not working?


Hi,

I had a similar problem, but after stepping through the new JavaScript libraries, I came to the conclusion that it was because the control passed to the PostBackOption constructor is not itself inside the UpdatePanel.

Moving it inside the UpdatePanel solved the problem.

Hope this helps,

Bo

Monday, March 26, 2012

Design approaches, AJAX of Master pages


Hello !

I'm migrating a website, all done with frames, from VS2003 to VS2005.
The layout of the website is a classical three columns with a header and a footer.

I want to remove frames but I would like advice on wether to use Master page or only AJAX.

Using AJAX, I would have one main page with the header and left column, clicking options on it
would load a HTML, CSS and javascript in the center column.
Fast and responsive but maybe hard to maintain and test.

Using a Master page, I guess I would have less changes to do since all the placeholders of the master page
would now be set as children of the master page. I haven't used Master pages yet so maybe
I don't understand the technology correctly.

Does anyone had the same concerns?
Can anyone tell me the pros and cons of this ?
Should I use a mix of the two approaches ?

My english is not perfect and I'm sorry for that, don't hesitate to ask for clearer details.

Thanks for any help !
Claude

You are correct - you do not understand the pratice of master pages correctly.

Masterpages in the Visual Studio 2005 enviroment are design time only. They are used as a way to manage a single layout across multiple content pages. When your site is complied or rendered, you end up with 1 page only. Masterpages should not be confused with frames in any way shape or form, they are not the same technology at all.

To understand this better - basically what you are doing is defining your layout, graphics, wrappers...etc in a master page. This is to maintain consistancy across all pages that would incorporate the design of that master page. So you can imagine a top header, a left column with links, and a center content area that you'd leave blank. In your content pages, you'd create the elements required to render content in that center area, without having to redesign, or duplicate the top and left column on each page. This is DESIGN TIME only.

When the pages are created and rendered. It'd be exactaly the same as designing your layout on each and every page. The pages are combined and sent down to the browser as a single html page, and nobody is the wiser.

To answer you're question. You should use Master Pages, AND javascript and Css (if thats your chosen technology) to render your pages. Using Masterpages for your layouts, and javascript css to render the center areas.

Master pages are "templates" that you build content pages around. They are not render time "frames".