|
hi Gautham,
Thanx for your valueble information
|
|
|
|
|
|
Use Javascript for this.
Regards,
Satips.
|
|
|
|
|
what do you mean by this post ?
|
|
|
|
|
Satips wrote: Use Javascript for this.
|
|
|
|
|
Sophia Rekhi wrote: am typing in URL bar like "www.yahoo.com" then it will fetch the data from exactly from yahoo server only
Request will first reach in DNS server and fetch the IP for yahoo.com and will be send back to browser. Browser will give a request to this IP and server will give the rendered HTML back to browser. Browser will display this
|
|
|
|
|
I have Xml file it contains many attributes.I want to just read EmlName and display it in table.
Like this.
Employee Name
1.Anup
2.Vijay
3.Kiran
.
.
.
.
Plz give me some solution or code
its urgent
thanks
GOD HELP THOSE WHO HELP THEMSELVES
|
|
|
|
|
You got to set the path xpath so that only that node (empl) is selected, then using a loop you could retrieve all the nodes in that emp node.
you can select the entry node and give node.childnodes[i].innertext....
you can find simple examples for xpath in w3schools!!
Hope this helps!!!
Gautham
|
|
|
|
|
HI
What is the size of the xml file if it is not very large then use XmlDocument object to read the xml file .
If file is large and you don't want to update it i.e only have to retrive the data and performance is an issue then use XmlReader to read the file as
you can use this code as reference for it
void ParseURL(string strUrl)<br />
{<br />
try<br />
{<br />
XmlTextReader reader = new XmlTextReader(strUrl);<br />
while (reader.Read())<br />
{<br />
switch (reader.NodeType)<br />
{<br />
case XmlNodeType.Element:<br />
Hashtable attributes = new Hashtable();<br />
string strURI= reader.NamespaceURI;<br />
string strName= reader.Name;<br />
if (reader.HasAttributes)<br />
{<br />
for (int i = 0; i < reader.AttributeCount; i++)<br />
{<br />
reader.MoveToAttribute(i);<br />
attributes.Add(reader.Name,reader.Value);<br />
}<br />
}<br />
StartElement(strURI,strName,strName,attributes);<br />
break;<br />
<br />
default:<br />
break;<br />
}<br />
}<br />
catch (XmlException e)<br />
{<br />
Console.WriteLine("error occured: " + e.Message);<br />
}<br />
}<br />
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hallo,
i have some questions about transforming a DataSet to HTML output. So i have a WebService which returns me a DataSet(it comes from a Access database). After that i create ASP.NET Web App and i'm calling the Web Sevice:
private MyService.Service1 ws = new MyService.Service1();
After that i have a DropDownList to filter the data from the Web Service and a Load Button. Then i expect a HTML page for output.
Here is the Code:
string currencyItem = DropDownList1.SelectedItem.ToString();
this.ws.Credentials = System.Net.CredentialCache.DefaultCredentials;
DataSet ds = new DataSet();
ds = ws.GetCurrency(currencyItem);
XmlDataDocument dd = new XmlDataDocument(ds);
XslTransform xslTransf = new XslTransform();
//string map = Server.MapPath("~/TestTransformation.xslt");
xslTransf.Load(@"C:\Inetpub\wwwroot\WebApplication3\TestTransformation.xslt");
StreamWriter sw = new StreamWriter(@"C:\Inetpub\wwwroot\WebApplication3\output.html");
xslTransf.Transform(dd, null, sw);
sw.Close();
Is this code right???
So i'm using a XSL file for the transformation and the its code is:
<xsltylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
Текущо състояние
<xsl:for-each select="DataSet/CCY">
| | Банкноти | Девизи | | За | Курс БНБ | Купува | Продава | Купува | Продава | Дата | <xsl:vaule-of select="CCYUNITS"> | <xsl:vaule-of select="RATEFIX"> | <xsl:vaule-of select="RATEBUYCASH"> | <xsl:vaule-of select="RATESELLCASH"> | <xsl:vaule-of select="RATEBUYACC"> | <xsl:vaule-of select="RATESELLACC"> | <xsl:vaule-of select="RATEDATETIME"> |
|
And here is the problem when i run the project and hit the load button it says that : 'xsl:vaule-of' cannot be a child of the 'td'???? Strange???
Can somebody help me???
Thank you in advance
|
|
|
|
|
If it's just a table you're outputting, then is there any reason you can't just bind the dataset to a gridview?
|
|
|
|
|
Thank you for the answer i know that if i use a DataGrid it will be a lot of easier for me but my task is to use a HTML output. Actually i found a mistake at my xsl code - not vaule-of it should be value-of...but now when i hit the load button nothing happens...the html page doesnt appeat but when i browse it from the solution explorer i see the stylesheet is accepted.
|
|
|
|
|
Hi! i want to extend GridView control for mouseover & mouseout effect. i.e. onmouseover the color of row become yellow & onmouseout the row restores its original color on client side. how can i achieve this??
Thanks & Regards,
SAMir Nigam,
Software Developer,
STPL, Lucknow, India.
|
|
|
|
|
I am not sure abt gridview, try to give some unique id's for each rows and write onmoumove and out events in javascript. When these events are fired do your calculations..
|
|
|
|
|
is it possible to keep a Dataset in Cache( Page or Application or Fragment) like session
Thanks in advance
-
|
|
|
|
|
One Post is Enough.
Regards,
Satips.
|
|
|
|
|
A session can hold a dataset
hope it works.
regards
|
|
|
|
|
Session ["MySessionVar"] = myDataSet not sufficient for you?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
is it possible to keep a Dataset in Cache( Page or Application or Fragment) like session
Thanks in advance
-
|
|
|
|
|
This Example will help you.
In the following sample a file is read in Application_Start (defined in the Global.asax file) and the content is stored in a DataView object in the application state.
C#
void Application_Start()
{
DataSet ds = new DataSet();
FileStream fs = new FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read);
StreamReader reader = new StreamReader(fs);
ds.ReadXml(reader);
fs.Close();
DataView view = new DataView(ds.Tables[0]);
Application["Source"] = view;
}
function Application_Start() : void
{
var ds:DataSet = new DataSet();
var fs:FileStream = new FileStream(Server.MapPath("schemadata.xml"),FileMode.Open,FileAccess.Read);
var reader:StreamReader = new StreamReader(fs);
ds.ReadXml(reader);
fs.Close();
var view:DataView = new DataView(ds.Tables[0]);
Application("Source") = view;
}
Regards,
Satips.
|
|
|
|
|
Hi in my project default page i am using frame set in that 3 html pages i included...,
When run the project it will check login authentication..,
If its correct user...,then in that default page head htmlpage my link buttons will display...,
When i click in that link left side html page sub links will be display...,
if i click any of the sub link then my aspx page will be display in that 3rd html page(right hand side)...,
In this i said suppose the user didnt interact with some what time the forms then session will be end...,so it will transfer to login.aspx page...,
But the login.aspx page is displaying on the right hand side of the frameset..,
But when session will end i need only starting page login.aspx other head html page and left side html page all want to unload
How to do this one plz tell me...,
-- modified at 2:03 Thursday 19th April, 2007
Magi
|
|
|
|
|
.net does not support frame concepts. so you can use this statement
i have test it with framework 2.0
c#
--
if (Session.IsNewSession)
{
Response.Write("top.location='login.aspx';");
}
vb.net
--
If (Session.IsNewSession) then
Response.Write("top.location='login.aspx';")
End If
|
|
|
|
|
Hi,
I wanted a Message Box that has Yes No Cancel where if the user click Yes only it will go to the next statement. Example
If MessageBox = "Yes" Then
'Do something
Else
'Do something
End If
I'd tried using javascript but I don't understand how the javascript can return "Yes" to ASP.net.
|
|
|
|
|
you can store javascript return in hidden type input and check this value at the server.
Regards
Shajeel
|
|
|
|
|
Hi Shajeel,
Actually I wrote a function for it like this
Public Sub MsgBoxYesNo(ByVal Message As String)
System.Web.HttpContext.Current.Response.Write("" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("if(confirm(""" & Message & """)){} else { return false }" & vbCrLf)
System.Web.HttpContext.Current.Response.Write("")
End Sub
Then only I realized when I call this function, I can't return the yes no from the javascript above such as Dim response As String = MsgBoxYesNo("Are you sure you want to delete")
J Liang
|
|
|
|