|
I don't think it's possible, unless you're somehow able to work out their timezone ( using geoip ) and work out the time from there ( which may not be the time their PC is showing ). This is why most web sites ask you what timezone you are in, because they can't work it out for themselves.
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 )
|
|
|
|
|
Use Javascript to get the client time:
vad d = new Date();
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi
i'd like to know how can i get fields values of DetailsView control.
I don wanna write connection, command,... codes
i like to put 1 sqlDataSource and DetailsView on my page to look for a record
then put the data to some labels around my page by getting DetailsView's fields values.
Thank you
|
|
|
|
|
found it!
in GridView it's like this:
grvExpenditure.Rows[index].Cells[ColumnIndex].Text
|
|
|
|
|
I have an aspx page in a project that was recently converted from VS 2003 to VS 2005. The page contains a UserControl which is located w/in the same application. Here's the file structure:
/includes/parent1/parent2/EditProfile.aspx
/includes/utils/StateDropDown.ascx
And I am getting the following error message from the VS compiler (not from the web because I can't compile the site): The virtual path '/includes/utils/StateDropDown.ascx' maps to another application, which is not allowed.
The project is file based, not http or ftp and there are no virtual directories in the project, so all directories w/in the project are in the same application. Why am I getting this error, and how can I fix it? Please help!
I've looked all over the web and all the related topics seem to relate to dynamically loading UserControls. The UserControl in question is added to the ASPX page using:
<br />
<%@ Register TagPrefix="uc1" TagName="StateDropDown" Src="/includes/utils/StateDropDown.ascs" %><br />
Thanks,
Mark
-- modified at 17:37 Thursday 21st June, 2007
|
|
|
|
|
Put a ~ at the front of the path, this maps to your application root. Or, use a relative path.
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 )
|
|
|
|
|
I have a GetData methd which is returning a table using sqldataadapter. I bound that datasource with GridView but now I want to invisible Gridview's first column but it gives me following error although I have 5 columns in my datatable.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
GridView1.DataSource = GetData();
GridView1.DataBind();
GridView1.Columns[1].Visible = false;
Thanks for help me in advance
seema
|
|
|
|
|
You must have called the code for making it "visible=false" before the gridview being bound to the datasource
put if(gridview1.rows.coun>0)
{
control.visible=false;
}
It should work.
I was born dumb!!
Programming made me laugh !!!
--sid--
|
|
|
|
|
What's wrong in the following statement.
if ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&& (Convert.ToInt32(e.Row.Cells[2].Text)>=17))
seema
|
|
|
|
|
seemamltn wrote: ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&
You have an extra bracket, it is suppose to be if ((Convert.ToInt32(e.Row.Cells[2].Text) >= 15) && (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
|
|
|
|
|
The syntax error comes from mismatching parentheses.
What's really wrong about the statement, is that if the value is >= 17, then it always is >= 15, so half of the code is totally superfluos.
if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
---
single minded; short sighted; long gone;
|
|
|
|
|
I have a date
startdate = '6/20/2007 11:21 AM'
enddate = Datetime.now
I want to calculate the difference betewwn enddate-startdate and then convert it into hours.
How can I do that in asp.net
Thanks
seema
|
|
|
|
|
TimeSpan ts = DateTime.Now.Subtract(DateTime.Parse("6/20/2007 11:21 AM"));
string strTimeDiff = ts.TotalHours.ToString();
|
|
|
|
|
I have a web form which has some radiobuttons in it. it looks like this:
asp:RadioButton ID="RadioButton1" runat="server" AutoPostBack="True" Checked="True" GroupName="aa" Text="r1"
asp:RadioButton ID="RadioButton2" runat="server" AutoPostBack="True" GroupName="aa" Text="r2"
asp:RadioButton ID="RadioButton3" runat="server" AutoPostBack="True" GroupName="aa" Text="r3"
asp:Label ID="Label1" runat="server"
in the vb file,
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.RadioButton1.Checked Then
Me.Label1.Text = "r1 is selected"
ElseIf Me.RadioButton2.Checked Then
Me.Label1.Text = "r2 is selected"
ElseIf Me.RadioButton3.Checked Then
Me.Label1.Text = "r3 is selected"
End If
End Sub
when the page is loaded, r1 is selected, then I click r2 and r3, then click BACK button in Internet explorer, the label text changed correctly, but not radiobutton selection. Can anybody explain it? and is there anyway to fix this?
thanks,
|
|
|
|
|
So let's say I have a Search textbox on a page and a login textbox on a page. When I hit the enter key on the keyboard I want it to fire the login button click event when the cursor is in the login textbox and fire the search button click event when the cursor is in the search textbox.
How does one handle that? I found some vague references in google about using javascript for this, but is there any C# asp.net native ways of doing this?
If js is the only way can someone post an example or a good url of where this is covered?
Thank you
|
|
|
|
|
u have to capture the key press event and you have to check the condition whether enter is pressed or not if pressed you have to dopostback on the control you want following the is the example to capture event.
in you aspx page under the for tag place your text box
<asp:textbox id="textBoxName" runat="server">
in page load event write the following code
If Not Me.IsPostBack() Then
textBoxName.Attributes.Add("onKeyDown", "javascript:checkEvent();")
End If
in your aspx page under the HEAD tag write the following javascript code
function checkEvent()
{
alert(window.event.keyCode);
if (window.event.keyCode==13)
{
__doPostBack("controlname",""); //please check the code i used to do like this only make sure view state of your control is true this is code i have used and it is working fone for me
}
}
Thanks
Warm Regards
Prakash-B
|
|
|
|
|
Hello Everyone,
Can anybody let me know how to solve this problem
Actually,i have designed a flash header and above this header i've designed a drop-down menu but the problem is whenever i drag my mouse over the dropdown then dropdown don't display clearly because of flash header the drop-down menu hides under the flash-header
Please suggest me some great ways
Thnx in advance
|
|
|
|
|
|
Hi, my requirement is to give users access to pick what fields or columns (these columns may be in few different tables) to select and the criteria of the report. Once they pick that, I would need to generate a SQL and run the report. I am not sure what the best approach is for this in ASP.net. Can anybody please help me.
Thanks,
Madhu.
|
|
|
|
|
madhu07 wrote: Hi, my requirement is to give users access to pick what fields or columns (these columns may be in few different tables)
If you allow users to select the columns on different table, on what criteria you will link the tables ? I mean when writing query what will be the condition you use in where clause ?
|
|
|
|
|
Thank you very much. I am going to join the tables and give users list of fields for them to select.
|
|
|
|
|
Hello
I need to count how many users are active in the website. Do you have any idea on this. I did using application variable. On session_start event in global.asax I am incrementing the application variable count and session_end event I am decreasing the count. But problem is when user closes browser no event will be fired. So I am not able to reduce the application variable count. It will show the old result. Do you know any method to handle this efficiently.
I am changing the application variable like this
Application.Lock();
Application["count"] = Application["count"] + 1;
Application.UnLock();
I know lock method stops modifying the variable value at same time. But what will happen if two users request at same time ? Will the second request wait's till application variable get unlocked ? Or that request will be skipped ??
|
|
|
|
|
This can be achived thru AJAX by doing the following
function saveSessionInfo()<br />
{<br />
if (window.event.clientX < 0 && window.event.clientY < 0)<br />
{<br />
AJAXMethods.CallAJAXMethod1(callback_saveSessionInfo);<br />
}<br />
}
call this method like
write your session handling end code here in this method
AJAXMethods.CallAJAXMethod1()<br />
{<br />
}
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|
|
hai every one,
i want to get a system user name,
if i deploy to iis i am not getting system user name.
i wont turn off anonymous as well as i get system user name
Dhatchinamoorthy.R
9894824838
|
|
|
|
|
I don't think it is possible to get the user name if you have enabled anonymous access.
|
|
|
|