|
Others on the same network (and you yourself) should be able to see it by replacing "localhost" with your computer's name. You may need to configure your network/OS firewall to allow HTTP requests.
|
|
|
|
|
I have a datagrid containing 2 coulmns with 1 TextBox in each.
On the first TextBox I have a TextChanged event.
After the event is fired I want to set Focus on the next textBox, and sellect the text on it.
<br />
private void OnSubscriptionToValueChanged(object sender, System.EventArgs e)<br />
{<br />
TextBox tb = (TextBox)sender;<br />
if (tb.Text.Trim() != "VAT")<br />
{<br />
tb.CssClass = "tbStyle0";<br />
DataGridItem dgi = (DataGridItem)tb.Parent.Parent;<br />
TextBox tbToFocus = (TextBox)dgi.FindControl("tbNextValue");<br />
tbToFocus.Focus();
}<br />
else<br />
{<br />
tb.Focus();
tb.CssClass = "tbStyleError";<br />
}<br />
}
The code over sets Focus on the control I want, but it don't select the text (as it would if the TextChanged event
wasen't there when you tab from one TextBox too another).
Has anyone an idèe how to do that?
Thanks
Thomas
|
|
|
|
|
Page.RegisterStartupScript("focus", "<script>document.getElementById('" + tbToFocus.UniqueID + "').focus();</script>");
Page.RegisterStartupScript("select", "<script>document.getElementById('" + tbToFocus.UniqueID + "').select();</script>");
|
|
|
|
|
Visual Studio 2005 says that the function is absolite, so one should rather use:
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "<script>document.getElementById('" + tbToFocus.UniqueID + "').focus();</script>");<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", "<script>document.getElementById('" + tbToFocus.UniqueID + "').select();</script>"); <br />
Thomas
|
|
|
|
|
And to expand on your solution. You should just strip off the <script> tags and add a fourth parameter with the value of true. This will ensure that the <script> tags are added automatically with the type attribute of the tag set to text/javascript which will make the output XHTML compliant.
Page.ClientScript.RegisterStartupScript(GetType(), "focus", "document.getElementById('" + tbToFocus.UniqueID + "').focus();", true);<br />
Page.ClientScript.RegisterStartupScript(GetType(), "select", "document.getElementById('" + tbToFocus.UniqueID + "').select();", true);
Kelly Herald
Software Developer
|
|
|
|
|
hi
I want to redirect the user to a mobile form when the requesting machine is a mobile irrespective of whether it has Pocket IE or some really ordinary browser.
<br />
Dim res As String = Request.Browser("IsMobileDevice")<br />
If res = "false" Then<br />
'when its a desktop machine requesting the page<br />
Response.Redirect(when_Desktop)<br />
Else<br />
'when its a mobile<br />
Response.Redirect(when_Mobile)<br />
End If<br />
Later I tried this code but it failed. I think HTTP headers help u to identify the model of the mobile. I just wanna know whether its a mobile or not.
How can I do it?
Thanks
Rocky
You can't climb up a ladder with your hands in your pockets.
|
|
|
|
|
Failed how?
Check here[^] for how to call this correctly.
|
|
|
|
|
i am using vs 2005 . i am a beginer.i want to upload a file. i have a file upload control and a upload button .when clicking upload button file shud be uploaded and should get a message in a label.how to do ity? pls help.
"I am burning...the only thing rest in me is you..."
|
|
|
|
|
A piece of advice, mr/s beginner:
people here will be glad to help with specific prohlems, but we are not here to do your work for you. There is a very good website called Google[^] which is invaluable for finding things out. For example, try searching for "asp.net file upload"...
|
|
|
|
|
Hi AccessRed,
I think you are very new in our forum. So, I would like to give you one suggestion. If you want to do something, don't forget to search in Google.
<a href="http://www.google.com/search?q=asp.net+file+upload&rls=com.microsoft:*:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7SUNA">ASP.NET File Upload</a>[<a href="http://www.google.com/search?q=asp.net+file+upload&rls=com.microsoft:*:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7SUNA" target="_blank" title="New Window">^</a>]
You can read those articles and try to test in your machine.. then, you will understand more about how things work. After that, if you are still facing the problem, you can come back here and ask the specific question. I think that the first link from the Google result that I gave you might solve your problem. Good luck.
|
|
|
|
|
sorry. there is no reply when I posted this thread..
|
|
|
|
|
Hi
I have developed an C# web application in VS2005. This executes well and fetch the mails in the Outlook 2003 in DEBUG mode, but when I am creating Virtual Directory and accessing using the local IP, i am getting the following exception:
Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005.
Madhan
|
|
|
|
|
Hi,
I'm having an web application that is exporting data to multiple excel worksheets.
Even though I haved added References and included the namespace , using Microsoft.Office.Interop.Excel, that Excel object is not coming in the Intellisense property. Because of that i'm not able to create the excel object.
I'm using ASP.Net 2.0. In version 1.1 it is working. Could anybody pls help or any url please?
Thanks
Meeram395
|
|
|
|
|
I think you might add the wrong one.. you should try to remove it and re-add it again.. I have tested in my machine and it works fine..
|
|
|
|
|
hi all,
i have a problem in renaming folder ,
problem as follows:
i am moving files from one folder to another folder it is moving files to new directory but it is reset the session value to null. how to solve this . or give me any idea with out using move method rename the folder . its very urgent please help me in this.
Thanks And Regards,
Guru
|
|
|
|
|
Thre is no reason why moving files or renaming directories should, in itself, end your session - there must be some other reason why this is happening.
|
|
|
|
|
i am trace out the problem but i read in forms while searching in Google they explained as if we move on directory to another directory it will reset the application state.if u know any another way to rename the directory please let me know.
Thanks And Regards,
Guru
|
|
|
|
|
I have a datagrid with an CalendarExtender conected to a TextBox in a DataGrid
<br />
asp:datagrid id="dgSubscription" runat="server" CssClass="grid" AllowPaging="False" CellPadding="0"<br />
GridLines="Vertical" AutoGenerateColumns="False" ShowFooter="true" OnItemCreated="dgSubscription_ItemCreated"><br />
<br />
Columns><br />
asp:TemplateColumn HeaderText="Date" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="150px"><br />
ItemTemplate><br />
asp:TextBox ID="tbDtmStart" runat="server" AutoPostBack="true"></asp:TextBox><br />
<cc1:CalendarExtender ID="ceStart" runat="server" Format="dd.MM.yyyy" TargetControlID="tbDtmStart" SelectedDate='<%#(DateTime)DataBinder.Eval(Container.DataItem, "dtmStart")%>'><br />
</cc1:CalendarExtender> <br />
I have an on item created in the code behind, hver I add a TextChanged event to the Date TextBox
<br />
protected void dgSubscription_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)<br />
{<br />
try<br />
{<br />
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
{<br />
<br />
tb = (System.Web.UI.WebControls.TextBox)e.Item.FindControl("tbDtmStart");<br />
tb.TextChanged += new EventHandler(this.OnSubscriptionDtmStartChanged);<br />
<br />
.....<br />
At first time the page load, the DataGrid.DataSource gets it values from
a dataview.
The problem is that the OnSubscriptionDtmStartChanged is
triggerd for every row in the DataGrid, because the CalendarExtender changes the TextBox's value.
There is allso a problem that the OnSubscriptionDtmStartChanged funtion i triggered 2 times
when I change the value on one of the DataGridRow.
I know that all of this has to do with the CalendarExtender changes the TextBox's value,
but can I some how get around this?
Thanks
Thomas
|
|
|
|
|
The problem was that I binded the Date to the CalendarExtender as:
<cc1:CalendarExtender ID="ceStart" runat="server" Format="dd.MM.yyyy" TargetControlID="tbDtmStart" SelectedDate='<%#(DateTime)DataBinder.Eval(Container.DataItem, "dtmStart")%>'><br />
All of my problems went away when I insted:
asp:TextBox ID="tbDtmStart" runat="server" Text='<%#((DateTime)DataBinder.Eval(Container.DataItem, "dtmStart")).ToString("dd.MM.yyyy")%>' AutoPostBack="true"></asp:TextBox><br />
<cc1:CalendarExtender ID="ceStart" runat="server" Format="dd.MM.yyyy" TargetControlID="tbDtmStart"><br />
</cc1:CalendarExtender>
Thomas
|
|
|
|
|
how to use the cursors for a select statement in a stored procedures to get the values in the asp.net applications
|
|
|
|
|
I think you need to do a brave bit more reading...
I think you want to execute your dataset using a SqlCommand object and then iterate through the results using a SqlDataReader.
You might want to have a look at the MS application block for data access, simplifies things a little:http://msdn2.microsoft.com/en-us/library/aa480458.aspx[^]
|
|
|
|
|
I created a web application in vs2008. I click run in that. It works. Then I create a virtual directory using IIS. From IIS itself, I try to run that application. But it shows the following error.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
A name was started with an invalid character. Error processing resource 'http://localhost/example/'. Line 1, Position 2
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="example._default" %>
-^
Can anybody help me.
I am using IIS 5.1
Thanks in advance
Regards
|
|
|
|
|
Just delete your cookies and try again i think this could be your problem.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
|
hi guys,
I am stuck on the issue of being able to call a javascrip function from my c# code.
This is my javascript:
<br />
<SCRIPT LANGUAGE="JScript"><br />
function showPosition()<br />
{<br />
var oElement = document.all.resultPanel;<br />
return oElement.offsetLeft;<br />
}<br />
</SCRIPT><br />
The javascript itself works fine, the problem comes down to how do I call my javascript in c#. This was my attempt:
<br />
private void CallJavascript()<br />
{<br />
string popupScript = "<SCRIPT LANGUAGE='JScript'>" + "function showPosition(){ var oElement = document.all.resultPanel; return oElement.offsetLeft;}</SCRIPT>";<br />
Page.RegisterStartupScript("PopupScript", popupScript);<br />
Label1.Text = popupScript.ToString();
}<br />
Can someone please help me correct the CallJavascript() method.
thanks
|
|
|
|