|
Let's say I've got a nice webpage layed out with some snazzy designer, but somewhere in the webpage I want some dynamic content fed by, say, XML, which will consist of some controls--buttons, grids, checkboxes, textboxes, whatever.
Sooo...what's the best practice for taking a webpage and "injecting" this content before it's served to the browser? How would the web server locate the area in which to add this content? Custom tags? A div section with a name that the web server looks for?
Is this something these newfangled technologies coming out of Microsoft can do?
Marc
|
|
|
|
|
I would go for a Div or a PlaceHolder control. I had used the PlaceHolder control in one of the project, the datagrid could not provide some functionality I needed and I had to write my own html table and fill it with controls dynamically, provide support for paging. I had no idea about AJAX at that time, or else I would have used some of the AJAX controls to avoid postback issues in few cases.
|
|
|
|
|
Marc Clifton wrote: Sooo...what's the best practice for taking a webpage and "injecting" this content before it's served to the browser? How would the web server locate the area in which to add this content? Custom tags? A div section with a name that the web server looks for?
I think the asp panel container will do this for you. In the page_load event of the page you can parse your XML custom content and add all the controls etc to the panel by name.
|
|
|
|
|
Personally, I'd look at a Custom Web Control with a configurable data source that can be an Xml file or something else, having the required elements defined in the documentation of course.
Configure the data source type and path via the config file and Bobs your uncle, something entirely re-usable - just a drag 'n drop control with configuration requirements.
Some basic examples, (not my work, just quickly sampled links Googled from my home machine)...
C# Help Article[^]
Code Project Article[^]
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
Hi
I am developing an application in asp.net.I used Media Player Embed Object.
It get buffer when user click on 'Play' Button.But I want to pre-buffer it.
In short I want Auto-Buffer that Media Player.
Please let me know if any body know the solution.
Swapnil Bhavsar
|
|
|
|
|
i am doing an application in which i want to split the cells of a columns in a row...
As it is difficult to show a pic here i can draw a pic for u to understand..
NAME ADDRESS City
State
Pin
i want the gridview to be viewed like this in runtime....
the name being under the name column and the city, state, and pin code being under a single column but as three cells horizonatally divided...
anyone please help me....
thanks in advance.....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|
|
In the address column cant you place three labels and thereby bind the data to your labels?
Gautham
|
|
|
|
|
its not as u wish...itz as i wish and my project leader wishes....
dont make silly points .....
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
|
|
|
|
|
hi,
try search in datagridgirl.com
|
|
|
|
|
hi
i am using asp.net 2003 with c#.
how can i set the timeout of session in my web applcation??
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Go to your web.config file and set the time-out for the sessionState element.
Note: the figure you enter would be in minutes!
Gautham
|
|
|
|
|
thanks
All I ever wanted is what others have.... CrazySanker
|
|
|
|
|
Hello to every One, there is one text box where i use to put date. i 'm using comparevalidator to check the textbox. it is working fine. now i want that when uuser select year for example"2006-07" or "2005-06" in the combo box then i can put only the values between the given years.
i tried RangeValidator but how to put the minimum and maximum values according to the combo box...
Suggest me..
Thank You.
|
|
|
|
|
Hi,
Can anyone tell me how i can include a file from my code behind page.
Regards
Sebastian
|
|
|
|
|
Include what type of file and where?
|
|
|
|
|
i want to include one file say abc.cs/abc.inc(which contains some global variables and enumerations) in my project. i hope i will be able to do this in html page like File
but i would like to include this from the codebehind.
Thanks
Sebastian
|
|
|
|
|
why don't place a panel and load a web user control into it?
Stef
|
|
|
|
|
Hi,
have you noticed my secomd post? can i use a user control for enum....?
if yes can you tell me how....
Thanks
sebastian
|
|
|
|
|
First you need to place the panel object on your page.
Then go to the code behind and add this where necissary:
<br />
Control c = Page.LoadControl("VirtualPathToControl.ascx");<br />
<br />
panelid.Controls.Add(c)<br />
This should work fine. is this what you wanted?
Stef
|
|
|
|
|
A cs file has nothing to do with your web page. An inc file is not the right way to use ASP.NET.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
it will be nice , if suggest an alternative
thanks
|
|
|
|
|
Well, if it's a file that contains css or javascript, put it in a master page, or a base class for all the pages on your site.
I was waiting for you to say what it was for, if it was a cs file, for example.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank You very much
Sebastian
|
|
|
|
|
You can use this sort of syntax
<!--#include file="header.inc" -->
in your code-behind if you want - and include global variables or functions within it - but place it before (outside of) the <script runat="server"> tag.
Fred
|
|
|
|
|
i didn't get you. the second step , can you explain this once more
thanks
sebastian
|
|
|
|