|
Hello,
I have an ASP.NET 2 app, recently converted from .net 1.1.
The app connects to a SQL DB.
Running the app under Windows 2000 server there were no issues. Now that I converted the app and run it under W2003 server it will "time-out" after about 15 minutes of leaving it idle. The error reported is: 4005
Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
I have tried these items from MS: http://support.microsoft.com/?scid=kb;en-us;918041&spid=8940&sid=global
And
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000009.asp
But none worked. The only thing that seems to work is this: http://www.cgnit.com/resources/ntauthority_networkservice_error.html
But my SQL Admin says we can't do that because of security issues.
Anyone have any ideas, comments or suggestions?
Much appreciaterd!!
Thks,
--PhB.
PhrankBooth
|
|
|
|
|
Hello all,
This is a kind of goofy situation I have here. Let me Try to break it down as best as I can:
Page1.aspx
- has a masterpage define
- includes page2.html that is in a subdirectory
(<!-- #include virtual="JavaStuff/Page2.html" --> )
Page2.html
- contains the JavaStuff.class applet that is located in the same directory
Now, when I navigate to Page1 the java console returns me a JavaStuff.class not found error. When I navigate directly to Page2 everything works fine. I've tried using absolute paths in the applet declaration but that breaks both pages. The reason I don't put the applet directly in the Page1 is because the HTML of Page2 contains some pretty odd-ball stuff that I don't want to break if I can avoid it.
Any ideas or suggestions? Thanks in advance.
-------------------
abort, retry, fail?
|
|
|
|
|
Hi,
I am having an ASP.NET button inside a panel.But when I click on this it is not firing the event.."Click" and it is not giving to the page_init,page
_load event on posting back..I tried with a new button added..It is still giving the same problem..
Any Idea will be much appreciated why this is happenening..
Pls show me the right way to resolve this..
Thank You,
RPM
|
|
|
|
|
I've found sometimes for whatever reason, Visual Studio sometimes disassociates button events. Usually all it takes for me to fix is to put in a Response.Write("button clicked") in the event handler. That usually gets things going, then you can just erase or comment out that line. It's some kind of wacky VS voodoo.
-------------------
abort, retry, fail?
|
|
|
|
|
Hi Jszpila,
Thanks much for the information....
I tried by putting the code Response.write("button clicked") inside the button click event..But still I cannot get the event fired...........
Thank you,
RPM.
|
|
|
|
|
If you are using VS2005 make sure the OnClick property is set in the markup for the asp:button, if you are using VS2003 make sure the event handler is being properly added in the generated code area.
|
|
|
|
|
Hi eggsovereasy,
I am using vs 2003..and event handler is added like
"Protected WithEvents BtnUpdate As System.Web.UI.WebControls.Button"
and in the button click it handles BtnUpdate.Click...
When I click it is not going to the Page_Init or Page_load event also..
Pls help...
Thank You,
RPM.
|
|
|
|
|
I used vs 2003 even i faced same problem, but i sort out the problem by deleting the onclick button event and again redo btnclick event becoz sometimes the click event is not fired( for ex in vs 2003 when u rename the button on click event it takes oldername ratherthen new button name but i remove the code declared for oldbuttonname in codebehind then problem is solved)
|
|
|
|
|
Hi,
I had same problem,But I solved that partially.Now Add new button in panel where your current button is present,Double click on new button it will go to code part just write anything and keep Breakpoint on statement,run your application and See whether brekpoint execure or not,then reply me.
Regards,
|
|
|
|
|
Any idea why GridView.Columns.Count is 0 when the grid view actually has 13 columns and renders that way on the screen?
I'm trying to get the number of columns in the DataBound event if that matters.
|
|
|
|
|
GridView.Columns does not include columns that are automatically generated (i.e. AutoGenerateColumns="true" )
If you are automatically generating columns, then to get the column count you need to go to the datasource. If your datasource is a DataTable for example, you would do something like this:
DataTable dt = GetMyData();
MyDataGrid.DataSource = dt;
MyDataGrid.DataBind();
int numColumns = dt.Columns.Count;
|
|
|
|
|
Ahh I see... what I really need is the width of the columns. Let me explain what I am trying to do and maybe some has a suggestion.
I want to put a one row table right on top of the gridview so that it looks like it is part of that table and I want the columns on this "Topper" table as I'm calling it to line up with the columns on the gridview. More specifically I want one of the columns on the Topper table to be as wide as two specific columns on the gridview so that it sort of groups them together under another heading, and then another topper column to be as wide as 8 of the gridview columsn to group them together. So, I was attempting to get the widths of the columns in the gridview and then programatically set the width of the corresponding columns in the Topper table. I suppose I could just set up the columns manually and turn off AutoGenerateColumns.
|
|
|
|
|
Okay - you can probably get the effect you are looking for, but not in the way you're thinking now. Let me try to explain why. When the GridView renders, it is outputting <tr;> and <td> tags, so the widths in this context is managed by the browser. Even if you explictly added a Width attribute to the individual cells of the table row, say in an OnRowDataBound event handler, I'm guessing you won't get the results you are looking for - the browser may still decide to render widths differently in the two tables.
But you might consider adding your topper row to the underlying table in the gridview directly. You could do this with an event handler for the DataBound event of the gridView. Something like this:
void MyDataBound(Object o, EventArgs e)
{
Table t = gv.Controls[0] as Table
if (t != null)
{
GridViewRow heading = new GridViewRow(0, -1
, DataControlRowType.Header
, DataControlRowState.Normal
);
TableCell cell = New TableCell();
cell.Text = "My Spanning Heading";
cell.ColumnSpan = gv.Rows(0).Cells.Count;
cell.MergeStyle(gv.HeaderStyle);
heading.Cells.Add(cell);
t.Rows.AddAt(0, heading);
}
} and your markup for the gridview would assign OnDataBound:
<asp:GridView ID="gv" runat="server"
OnDataBound="MyDataBound"
/>
|
|
|
|
|
Adjusted the colspans and added some more cells and it works perfectly, thanks a lot for the tip!
|
|
|
|
|
|
How can i reflect changes in database through DataSet?
I have Items table with three columns[Item,UnitPrice,Quantity] in my database(mydb). I get that data in a DataTable through SqlDataAdapter. I create a DataRow), populate its fields, write it to the table, and call on AcceptChanges() method. But actually this row is not added to the table.
I wana reflect this change in table. The code is as under:
Sub Page_Load
Dim connString As String
connString="server=pc1;database=mydb;trusted_connection=true"
Dim conn As New SqlConnection(connString)
Dim cmd As New SqlCommand("Select * From Items",conn)
Dim adapter As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
conn.open()
adapter.fill(ds,"Items")
dim dr As DataRow=ds.Tables("Items").NewRow()
dr(0)="Item3"
dr(1)=44
dr(2)=44.4
ds.Tables("Items").Rows.Add(dr)
ds.Tables("Items").AcceptChanges()
adapter.Update(ds.Tables("Items"))
conn.Close()
MyDataGrid.DataSource=ds.Tables("Items")
MyDataGrid.DataBind()
End Sub
Thanks
|
|
|
|
|
don't call accept changes, the update runs on all rows marked as updated, which you wipe out when you call .AcceptChanges.
|
|
|
|
|
Thanks for reply. But none of these steps reflect changes in database.
|
|
|
|
|
Hi, I've tried to create a business object that can fully bind to the ObjectDatasource to be used in a DetailsView object for example. Everything works f ine here, but I cannot seem to get the deletemethod to do anything. This is the testobject I created:
public class BO
{
private int _id = 0;
public int Id
{
get { return _id; }
set { _id = value; }
}
private string _Field = string.Empty;
public string Field1
{
get { return _Field; }
set { _Field = value; }
}
private string _Field2 = string.Empty;
public string Field2
{
get { return _Field2; }
set { _Field2 = value; }
}
public BO() { }
public BO(string fld1, string fld2)
{
Field1 = fld1;
Field2 = fld2;
}
public BO LoadMe()
{
return (HttpContext.Current.Session["bo"] != null)?(BO)HttpContext.Current.Session["bo"]:new BO();
}
public void AddMe(BO bo)
{
HttpContext.Current.Session["bo"] = bo;
}
public void DeleteMe(BO bo)
{
BO InMem = (HttpContext.Current.Session["bo"] != null) ? (BO)HttpContext.Current.Session["bo"] : new BO();
if (InMem.Id == bo.Id) // Why is bo empty ??
HttpContext.Current.Session["bo"] = new BO();
}
I created a page with an objectdatasource, selecting LoadMe as the SELECT method, AddMe() as the INSERT method, and DeleteMe() as the DELETE method. The odd thing is that DeleteMe() fires, but the parameter bo is passed with just empty values..
Does anyone know what I'm doing wrong (if I'm doing something wrong) ?
Never mind the working of the object, I just need the Delete method to work.
tia,
Patt
-- modified at 10:37 Thursday 22nd June, 2006
|
|
|
|
|
Do you set the ID field in the DataKeyNames property of the DetailsView control?
|
|
|
|
|
That worked. Thanks. Eh, you wouldn't know how to keep it working even if I set the ID field readonly ?
|
|
|
|
|
Another option is that you can create the handler for the Deleting event of the ObjectDataSource control, in the handler you can set the Id or whatever property of the BO object stored in the e.InputParameters collection, this object is then passed to the Delete method as the parameter.
|
|
|
|
|
Hi Developers
I have been looking for Free AJAX enableb controls or Framework for ASP.net, but I dnt get any kool one. Most of these are commercial and very difficult to use.
Please let me know if you know about any simple+free AJAX enabled control for .NEt.
Note: I am using VB.net with ASP.net 1.1
Thanks in advance!
Lets work it Out.........!
-- modified at 10:37 Thursday 22nd June, 2006
|
|
|
|
|
!..Web Guru..! wrote: Most of these are commercial and very difficult to use.
hmmmm.....not a very good thing for a !..Web Guru..! to say...
You'll probably find that they're all pretty complex - in order to appeal to as wide an audience as possible, they must contain as many features as possible - meaning that they complicate quickly and tend to have fairly steep learning curves....
AJAX isn't difficult - why not try creating your own controls and components derived from the standard ones?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I have created a table on my page dynamically and in each cell I want to create a hyperlink that is invisible to the user but one 'clicked' will allow me to program the event in my code behind page which is vb.net? I cannot access the html code of the hyperlink as it is created on the fly.
From what I understand does the hyperlink not have an onclick event that can be responded to?
I am trying to mimic an excel spreadsheet with my table and want the user to click in a cell and have the background change to black to make the cell look selected.
I have this: (this is just part of it)
MyTable.Rows(i + 1).Cells(k + 1).BackColor = System.Drawing.Color.Black
Dim strHello As String
strHello = "Edit"
Dim e_link As HyperLink = New HyperLink
MyTable.Rows(i + 1).Cells(k + 1).Controls.Add(e_link)
If IsPostBack Then
MyTable.Rows(i + 1).Cells(k + 1).HorizontalAlign = HorizontalAlign.Center
e_link.ForeColor() = System.Drawing.Color.Black
e_link.Text = strHello
AddHandler e_link.Click, AddressOf e_link_Click
with this event handler placed lower
Private Sub e_link_Click(ByVal sender As Object, ByVal e As EventArgs)
Response.Write("You clicked Me!")
End Sub
Thanks
|
|
|
|