|
|
hi there,
thanks for your reply. unfortunately Control.DesignMode is .net 2.0 and I'm still on 1.1
anmore hints or ideas?
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
Two options at least come to mind:
+ Use the DesignMode[^] property of the Site[^] object, however be aware that the Site object does not exist at runtime.
+ Check something that only exists at runtime for example the current http context: HttpContext.Current .
|
|
|
|
|
With only one record on my 2nd page in my datagrid, when I go from page 2 to page 1 in my Datagrid (ASP.NET v1.1), I get:
Input string was not in a correct format.
[FormatException: Input string was not in a correct format.]
Microsoft.VisualBasic.CompilerServices.DoubleType.Parse(String Value, NumberFormatInfo NumberFormat) +193
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +92
[InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Microsoft.VisualBasic.CompilerServices.IntegerType.FromString(String Value) +206
Work_PackageVBConvert_P3E.SARESTableSubform.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) +185
System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e) +109
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) +589
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) +106
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +26
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292
****************************************************************
I have no idea what's going on or why this is happening. If I add another record to my datagrid, and now I have two rows on my second page, I can go to the first page successfully.
The PageIndexChanged routine is simply:
DataGrid1.CurrentPageIndex = e.NewPageIndex
Call DG()
Any ideas?
Thanks!
|
|
|
|
|
AFAIF many people have the similar problem and one of the reasons is the bug in the ASP.NET 1.1, so you may want to search for the Microsoft KB. However, the error stack tells me that the control was deleting something as the DeleteCommand event gets fired ????
|
|
|
|
|
...and that's what I couldn't figure out as far as the DeleteCommand getting fired. When there are two records on the 2nd page, there's no exception thrown when I click the #1 page link. If I delete one record from the 2nd page and now there's only 1 record on that page, the exception get's thrown when I click the link to go to page #1. Why does the DeleteCommand get fired when I click the page #1 link?
I tested my original datagrid, and it doesn't do this...it's works fine. The only difference is the edit item template for this current datagrid where I put two dropdown lists and two text boxes in one column, so the user didn't have to scroll horizontally. The original datagrid, which changes my 4th text box/column to a ddl, and my 6th textbox/column to a ddl doesn't throw any errors. Weird......but at least it's a better UI than before, and I just display a tiny error message.
Thanks!
|
|
|
|
|
I have a website project in visual studio 2005 and I want to apply security using Sessions
is there a simple way to do this???
|
|
|
|
|
I upgrade my site from asp.net 1 to 2.0 and everything work fine on localhost. However, after I upload my website to my host and I got the following message:
Server Error in '/asi_web' Application.
--------------------------------------------------------------------------------
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I check my web.config file and the <customErrors mode> is "Off" and I also check to see if my web.config file is valid by copying it to notepad and view it in a browser. Everything looks OK. I also call our host to check if asp.net 2 is installed and they told me it is. Therefore, I am stuck and do not know what to do. Any help would greatly reduce my pressure from my boss.
Rookie Programmer
|
|
|
|
|
Rookie wrote: I check my web.config file and the <customerrors mode=""> is "Off"
It seems like the file is not used at all. Plant a deliberate error in the file to see if you get a configuration error.
---
b { font-weight: normal; }
|
|
|
|
|
Thank you for your help.
I have created an invalid web.config file and still gets the same error. Looks like web.config file is not being read. This is very strange.
Rookie Programmer
|
|
|
|
|
Then you should contact your host and ask where the actual root of the application is.
If your site is not a web application, it's not a proper site. It's just a folder in some other site.
---
b { font-weight: normal; }
|
|
|
|
|
I have an iframe that takes its src from another .aspx page(say, chatmessage.aspx).
Chatmessage.aspx is filled in runtime making its .aspx page increase step by step....
The problem is, when i call this chatmessage.aspx from iframe that resides on another page(say Chatwindow.aspx),
iframe focus is not getting set to last text. i.e. the focus is automatically set to the start of the page in iframe rather than ending of the page.....Can someone help..Urgent!!!!
|
|
|
|
|
I would imagine you have set the focus on chatmessage.aspx... the iFrame simply displays the content of that page.
Could you please explain what form element it is that you are trying to focus on?
Nila
|
|
|
|
|
Place a bookmark at the end of the page and add the bookmark to the URL.
---
b { font-weight: normal; }
|
|
|
|
|
Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand
Dim d As String
d = DataGrid1.DataKeys(e.Item.ItemIndex)
cmd = New SqlCommand("DELETE FROM functional WHERE comp=@comp", con)
cmd.Parameters.Add("@comp", d)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
deletedata()
and
Sub deletedata()
Dim ds As DataSet
Dim strSQL As String = "select FROM functional "
da = New SqlDataAdapter(strSQL, con)
ds = New DataSet
con.Open()
da.Fill(ds, "functional")
con.Close()
DataGrid1.DataSource = ds
DataGrid1.DataMember = "functional"
DataGrid1.DataKeyField = "comp"
DataGrid1.DataBind()
End Sub
what wrong with it
-- modified at 11:40 Thursday 17th August, 2006
omi
|
|
|
|
|
omi98 wrote: what wrong with it
Nah, you need to tell us in details what wrong with it so that we may help you figure out the cause.
|
|
|
|
|
after click on delete link in datagrid it shows following error
Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
omi
|
|
|
|
|
+ Can you try to debug your application to see which line (or which code) is causing the error?
+ Can you also post the error stack?
|
|
|
|
|
i forword source error and stack trace
boldline indicate error line
Line 127: Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand
Line 128: Dim d As String
Line 129: d = DataGrid1.DataKeys(e.Item.ItemIndex)
Line 130: cmd = New SqlCommand("DELETE FROM functional WHERE comp=@comp", con)
Line 131: cmd.Parameters.Add("@comp", d)
******************************************************
Stack Trace
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
System.Collections.ArrayList.get_Item(Int32 index) +91
System.Web.UI.WebControls.DataKeyCollection.get_Item(Int32 index)
WebApplication2.WebForm12.DataGrid1_DeleteCommand(Object source, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\WebApplication2\js\WebForm12.aspx.vb:129
System.Web.UI.WebControls.DataGrid.OnDeleteCommand(DataGridCommandEventArgs e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
omi
|
|
|
|
|
Hi.
My problem is simple, but detailed.
Instead of creating list items for the drop down list (Mr,Mrs,Miss), I would like to instead get the information from a table in SQL server DB which holds thats information.
The table has 2 fields.. UserTitleID and Description.
There is another User table, holds the foreign key "inUserTitleID". I need to be able to store new users in the User table, selecting the entries from a drop down list with entries which the UserTitle table can hold(variable number-not fixed like list items).
I request for a hint(or a push in the right direction) on how to tackle this issue..
PS. Sorry if this sounded more like a rant =(
Thanks.
-- modified at 11:38 Thursday 17th August, 2006
|
|
|
|
|
One way is to read the items into a DataSet and use that as DataSource for the DropDownList. Set the DataTextField and DataValueField properties to the names of the fiels in the DataSet. Assign the DataSet to the DataSource property and call the DataBind method to populate the list.
Another way is to get the items using a DataReader and iterate the reader to populate the list. Read the values from the DataReader and use them to create a ListItem object for each item and add it to the list.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for the suggestions.
I'll get cracking on then
|
|
|
|
|
|
Thanks for the link!
|
|
|
|
|
Hi there,
I am currently looking into how we can integrate PHPBB into an ASP .NET website, by integration, I do not simply mean placing the forum into and IFrame and forgetting about it...
One of the main challenges is to implement a 'Single Sign On' mechanism, has anyone here done something like this? any suggestions?
My ideas are along the lines of, accessing the PHPBB (mysql) database using Connector.NET and 'planting' an auth cookie for PHPBB when the user logs in, are there any known issues with this approach?
Any general advice would be welcome.
Thanks,
Paul
|
|
|
|