|
try this
System.DateTime.Now.ToString("MM/dd/yyyy");
ToString() is overrriden in DateTime Class so u can manage the Format by using the above method.
|
|
|
|
|
ASP.NET does not run under the account you are currently logged in as. It runs under the .NET account. You can check the short date format for all of your acounts in the registry editor by looking at 'HKEY_USERS > [USER] > Control Panel > International > sShortDate' for each user account.
|
|
|
|
|
thank you, i think that's what I was looking for
|
|
|
|
|
i cant run my program, there's an error:
Type 'BOOK_Locator.Dataset1' is not declared
in codes:
Friend WithEvents DataSet11 As BOOK_LOCATOR.DataSet1
i have connected my database in connection wizard properly but why there's an error in it? how can i fix?
|
|
|
|
|
Don't put a useless subject like "please help me". Almost every thread here is about someone needing help, so it doesn't do anything at all to distinguish the thread from others.
Don't repost the same question. Especially not so soon after the previos one.
---
single minded; short sighted; long gone;
|
|
|
|
|
make sure of the spelling of the Object name.....otherwise try
Clean Soloution from the Bulid Menu
|
|
|
|
|
in codes, there is BOOK_LOCATOR.DataSet1 and you got error like 'BOOK_Locator.Dataset1'.So may be this because of case sensitive..Check for that too...Otherwise, take a fresh dataset and try once.
suchitamanandhar@hotmail.com
|
|
|
|
|
i have made class named "ServerPaths" and it includes one function named "getServerImagePath()".
function definations is:
public string getServerImagePath()
{
ImagePath= MapPath(AppRelativeVirtualPath.ToString()).ToString();
return ImagePath;
}
Now i want to use this class to get the imagepath in .aspx source view. I mean in html.How can i get this ????
modified on Monday, May 10, 2010 10:11 PM
|
|
|
|
|
If you are using Server-side Image control,
Image1.ImageUrl = getServerImagePath();
If you are using HTML image tag,
<img src="<% =getServerImagePath() %>" />
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
If you have this variable as protected in codeBehind, in ASPX page, you can say
<%=strPath%>
|
|
|
|
|
Hi,
I have an ASP.NET AJAX enabled user control which is using ResizableExtender and DragPanelExtender from ASP.NET AJAX Toolkit.I am creating this control dynamically on a page. Page has an UpdatePanel also which is acting as container for this control. On page there is a button for creating this control. Upon clicking on this button control is added to the page. When we click on button page is posted back to the server and i create control in Page_Load event handler. I have no problem with control's state or values in it but i want to create it without using Page events(Init,Load etc). Is there a way we could create a user control using Javascript and AJAX techniques without relying on Microsoft Extensions.
Any help will be greatly appreciated.
Thanks,
Ahmad
|
|
|
|
|
Hi i woud like to know how to retrive a session state from a Class.
Thanks in advance
|
|
|
|
|
Console.WriteLine(Session["mysession"]); ??
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Normaly This woud be ok, but I wan't to retrive session from class, that the class isn't inherited from anything.
So I Can't access Session class
|
|
|
|
|
Where did you put this class? in Web Project or somewhere??
I have tried with the following code. it works..
In Default.aspx
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
Session["mysession"] = "d";<br />
<br />
}<br />
protected void Button2_Click(object sender, EventArgs e)<br />
{<br />
Class1 obj = new Class1();<br />
Response.Write( obj.getValueFromSession("mysession"));<br />
}
In Class1.cs
<br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
<br />
public class Class1<br />
{<br />
public Class1()<br />
{<br />
}<br />
public string getValueFromSession(string key)<br />
{<br />
return HttpContext.Current.Session[key].ToString();<br />
}<br />
<br />
}<br />
it works fine.. Please try againn.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Gonna try when i get home in about 6 hours
|
|
|
|
|
|
HttpContext.Current.Session
We Can Do Anything, If We Want It
|
|
|
|
|
Within the context of web application,
HttpContext.Current.Session["name"]
|
|
|
|
|
Already tried that.
Didn't help.
I can't remeber the error, because currently i am not home.
|
|
|
|
|
If it is a compilation error, then try using
System.Web.HttpContext.Current.Session["Name"]
The assembly should have a reference to System.Web .
|
|
|
|
|
Thanks, This one helps.
I had compilation error saying my Session doesn't belong to HttpContext
|
|
|
|
|
Hi,
I have a page1.aspx , there i have a link button on click of which i opens a pop up window.
My requirement is that when my pop up window is opened then the user should not be able to perform any action on the page1.aspx
I used a modular window for this, but again i have a linkbutton on that modular window, clicking on it opens a new url in new window.But i want it to be in same modular window.
So any of the thing can resolve my problem
1> A pop up window where user cannot perform any action on page1.aspx
2> A modular window, having link button , clicking on it should open the new page in it self
Is there any way to make the Page1.aspx disabled (fade color with)when pop up window is active.
thanx
|
|
|
|
|
sandeep kumar pundhir wrote: A pop up window where user cannot perform any action on page1.aspx
Use window.showModalDialog instead of window.open .
sandeep kumar pundhir wrote: A modular window, having link button , clicking on it should open the new page in it self
use HTML "a" link instead of link button..
hope it helps....
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I have a modestly complex custom page within a repeater which receives one record at a time from another (gridview) page for update of a sql table row.
Among the controls on this page are cascading dropdown lists, each dependent on the previous selection. Population of succeeding lists is accomplished via a SelectedIndexChanged Sub. This must of necessity refer to the previous control by name as in Alpha.SelectedItem.Text. Since Alpha is within the repeater, it must be qualified. I've tried every combination I can think of but nothing identifies Alpha.
The master page is Master, the container is Container1, the repeater is Repeater1, and the dropdownlist is Alpha. How do I do this (in VBScript)?
Thanks
|
|
|
|