|
Thank you for your comments. Now I think it won’t be possible to convert to html from xml without defining a XSLT. Can anybody tell me the best way to write an xslt for the above code segment? All the controls have been defined in the xml in the same order it must appear in the web page.
Krishnaraj Barvathaya B
|
|
|
|
|
Converting to HTML is a canonical example, any XSLT book or website will show examples.
\
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
How to validate listbox control. in listbox control has many items. The selection mode for this is multiple.The condition is that user can select only 3 items.if it exceeds error msg to display. please give me the solution for this with code.
|
|
|
|
|
dhandapani_pp wrote: please give me the solution for this with code.
Gimme your pay check
Anyway, the idea would be to check the number on selected items on every SelectedIndexChanged Event. If it is greater than 3, show the error message.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Send me code for that one
|
|
|
|
|
One thing you can do
Take a hiddenvariable.set it 0 .Increment it by one every check.When it excedds from 3 show a error message.
Cheers!!
Brij
|
|
|
|
|
Can u send me code for this
|
|
|
|
|
I have some data passed to a function as a string like:
"<?xml version=\"1.0\" encoding=\"utf-16\"?><Patient xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><FirstName>Joe</FirstName><LastName>Klink</LastName></Patient>"
I load this data into an XmlDocument object as follows:
mXmlDocument.LoadXml(var) - var has the xml string above
how can I validate this XmlDocument object against an existing schema.
Background: I can easily validate an xml file against a schema if am reading it from a physical file using XmlReader. My challenge is when am dealing with a loaded XmlDocument.
Thanks
|
|
|
|
|
XMLDocument.LoadXML supports loading from a XMLReader instance. XMLReader can be loaded from a stream. You can make a stream from the XML string you have. So if you know how to validate on a XMLReader, I think it can be applied here.
|
|
|
|
|
Thanks man.
I had a feeling this is the work around I would need to use. The thing I have to focus on now is how to 'make a stream from the XML string'. I am googling my way to it but if you have some quick pointers I will be glad to hear. Thanks once again.
|
|
|
|
|
Use the other overload which takes a TextReader instance. Your code would be
StringReader stringReader = new StringReader(YourXMLString);
XMLReader reader = XMLReader.Create(stringReader,settings);
XMLDocument document = new XMLDocument();
document.LoadXML(reader); StringReader is a subclass of TextReader .
|
|
|
|
|
Your proposal is very correct. Though with my mXmlDocument, all I did was:
XmlReader mXmlReader = XmlReader.Create(new StringReader(mXmlDocument.OuterXml), mReaderSettings)
|
|
|
|
|
For validating a XMLDocument object you have to follow the below steps:
first create the XmlReaderSettings object
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add("urn:xmlns:25hoursaday-com:my-bookshelf", xsd);
settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallback);
settings.ValidationType = ValidationType.Schema;
Then create the validating XmlReader object and the XmlDocument object.
XmlDocument mXmlDocument = new XmlDocument();
mXmlDocument.Load(XmlReader.Create(document, settings));
Now validate the XMLdocument
mXmlDocument.Validate(new ValidationEventHandler(ValidationCallback), element.ParentNode);
Cheers!!
Brij
|
|
|
|
|
how i can refresh datagrid of contentplaceholder1 when contentplaceholder2 panel input data in database using ajax. i am not want to refresh?
I will do my best?
|
|
|
|
|
you can use one updatepanel in contentplaceholder1 and another in contentplaceholder2 and set the updatemode of both "Conditional".Now when you provide input in contentplaceholder2 after successfully updation in database ypu can call the updatepanelId.Update() for the updatepanel in contentplaceholder1.
Cheers!!
Brij
|
|
|
|
|
AspDotNetUser wrote: how i can refresh datagrid of contentplaceholder1 when contentplaceholder2 panel
R you using Multiple ContentPlace Holder on Master Page or you want to talk about multiple update panel.
if you are using multiple updatepanel , use updatepanel.Update() method and Make mode="Conditional"
Rest try to do !!!
|
|
|
|
|
thanks to reply
i use multiple contentplaceholder on master page. and as u suggest for multiple updatepanel i try this but i have multiple contentplace holder on master page.
i use updatepanel1.update();
after edit data on save button but data in datagrid not refereshed. while i use datagrid on same contentplace holder than value refereshed means work is done but datagrid not refereshed. how can i solve problem.
I will do my best?
|
|
|
|
|
change UpdateMode="Conditional" of updatepanel1
|
|
|
|
|
thanks to reply
yes that is already conditional beacause its also have trigger control for the dropdownlist or manymore buttons.
I will do my best?
|
|
|
|
|
thanks to all. my problem is solved. many many thanks to all.
I will do my best?
|
|
|
|
|
i m using dropdownlist in my gridview edititemtemplate, when i click update of gridview to send values in database i m getting error (Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.)
for testing i use GridView2_RowUpdating event and write all the update code in it, its working fi9 values r going in DB, then after this execution end i get the same old error screen ... ? i m confused plz help.
thnkx in advance.
|
|
|
|
|
i don't understand what u want to do? please explain your question?
I will do my best?
|
|
|
|
|
dream_liner_7e7 wrote: (Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'nvarchar'.)
Your exception tell every thing. please debug your code
|
|
|
|
|
ok the simple question .. how to update values from gridview, when gridview update link is clicked??
thnx in advance
|
|
|
|
|
I posted in here the other day about getting a result from a popup window holding a calendar and the reponse I had was very helpful and that is since working. I am now moving on to the next section. This is where the user can select multiple things in a pop up window and pass them back or just one, or all. I have set it up so a list box displays all the areas that they can chose from and then along the bottom are the options to select all, or they can select individual items from the list box and click ok. The all bit is working fine as that’s just a matter of passing back a string that says all, which is similar to that of passing back the calendar date. However the multiple selection option is proving more difficult so far I have it set up so each item that they have selected is saved into an ArrayList. Is it then possible to pass back the ArrayList and populate a multiline text box with the values in the array list, I presume the passing back of the ArrayList would be fairly similar. It’s the displaying of the values with in it I am having trouble with.
Any help as always is greatly appreciated.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|