|
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
|
|
|
|
|
you cannot stop next statement like this, because javascript is executed after all code behind is executed, you have to take two round trips here in which case the better option will be show a simple page with message and yes and no button with proper redirection and not by script.
Regards
Shajeel
|
|
|
|
|
Alright then, thanks for the advice, I shall create a new window for that then.
J Liang
|
|
|
|
|
use btn.attributes.add("onclientclick","function()";) on page load
|
|
|
|
|
Hi,
Just want to confirm something. The onclientclick is something like onclick which I can keep the way it is here? And the function(), it is the javascript function which I embedded it in my HTML? Because when I try that, the message box didn't pops out...
J Liang
|
|
|
|
|
Hey,
Thanks for the code, it's working now, didn't know it was that simple
J Liang
|
|
|
|
|
copy this code in any cs file and access it.
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
///
/// Summary description for MessageBox
///
public class MessageBox
{
public class MessageBox
{
private static Hashtable m_executingPages = new Hashtable();
private MessageBox() { }
public static void Show(string sMessage)
{
// If this is the first time a page has called this method then
if (!m_executingPages.Contains(HttpContext.Current.Handler))
{
// Attempt to cast HttpHandler as a Page.
Page executingPage = HttpContext.Current.Handler as Page;
if (executingPage != null)
{
// Create a Queue to hold one or more messages.
Queue messageQueue = new Queue();
// Add our message to the Queue
messageQueue.Enqueue(sMessage);
// Add our message queue to the hash table. Use our page reference
// (IHttpHandler) as the key.
m_executingPages.Add(HttpContext.Current.Handler, messageQueue);
// Wire up Unload event so that we can inject some JavaScript for the alerts.
executingPage.Unload += new EventHandler(ExecutingPage_Unload);
}
}
else
{
// If were here then the method has allready been called from the executing Page.
// We have allready created a message queue and stored a reference to it in our hastable.
Queue queue = (Queue)m_executingPages[HttpContext.Current.Handler];
// Add our message to the Queue
queue.Enqueue(sMessage);
}
}
// Our page has finished rendering so lets output the JavaScript to produce the alert's
private static void ExecutingPage_Unload(object sender, EventArgs e)
{
// Get our message queue from the hashtable
Queue queue = (Queue)m_executingPages[HttpContext.Current.Handler];
if (queue != null)
{
StringBuilder sb = new StringBuilder();
// How many messages have been registered?
int iMsgCount = queue.Count;
// Use StringBuilder to build up our client slide JavaScript.
sb.Append("");
// Loop round registered messages
string sMsg;
while (iMsgCount-- > 0)
{
sMsg = (string)queue.Dequeue();
sMsg = sMsg.Replace("\n", "\\n");
sMsg = sMsg.Replace("\"", "'");
sb.Append(@"alert( """ + sMsg + @""" );");
}
// Close our JS
sb.Append(@"");
// Were done, so remove our page reference from the hashtable
m_executingPages.Remove(HttpContext.Current.Handler);
// Write the JavaScript to the end of the response stream.
HttpContext.Current.Response.Write(sb.ToString());
}
}
}
}
|
|
|
|
|
Hi,
Sorry, ermm...this look a bit complicated for me but thanks really for your response, I shall try to check out how your code work here.
J Liang
|
|
|
|
|
Hi all,
i have one doubt. is it possible to use asp files to asp.net project??
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Yes, you can. You can also just rename them to be asp.net (aspx) and make sure you add the runat="server" attributes. Work the same as when you want to use html in asp.net.
|
|
|
|
|
List<object[]> topics = Database.SerializeQuery();
repeaterTopics.DataSource = topics;
repeaterTopics.DataBind();
I am filling my repeater's datasource with a type List <object[]>.
Normally to access these elements, in C# I would use, for example: topics[0][1].
However since it's in my repeater how do access the individual elements from the aspx page using the repeater syntax?
<div id='topics'>
<asp:Repeater ID="repeaterTopics" runat="server">
<ItemTemplate>
<!--How do I access the List here?? -->
</ItemTemplate>
</asp:Repeater>
</div>
/\ |_ E X E GG
|
|
|
|