strange problem with link buttons

  • Thread starter Thread starter David
  • Start date Start date
D

David

This is something I had never seen before.

On an aspx page, upon pressing a link button for which I have an event
handler in the code behind, the screen shows nothing but a line that says
"true" up in the right upper corner of the browser.

I have an XP and had just installed XP Service Pack II...against my better
judgment. Please help. Thanks.
 
Hi David,

can you post your code ?
this sometimes happen if there are some mismatched html tags.
 
Hi David,

Its very difficult to figure out the error with the info you have given.
Can you post the code that you have written for the button click event.

Thanks
Raghavendra
 
Here's one of the event handlers. I doubt that is where the problem lies.

private void btnViewPermit_Click(object sender, System.EventArgs e)

{

if (this.permitID == 0)

{

common.showPopUpMessage("No Permit to view", this);

return;

}

Context.Items.Add(MODE, VIEW);

Context.Items.Add(PERMIT_ID, this.permitID);

Server.Transfer("permit_viewedit.aspx");

}
 
See my reply to Ashish M Bhonkiya.

Do you have any idea under what circimstances the page would display nothing
but "true"? What is true? Makes no sense whatsoever.
 
Here is my entire html page (note the pre tag which is not included on my
page, but I did it as a workaround to show my html)
<pre>
<%@ Page language="c#" Codebehind="notice_viewedit.aspx.cs"
AutoEventWireup="false" Inherits="Belshire.Petrotools.Web.notice_viewedit"
smartNavigation="True" %>
<%@ Register TagPrefix="uc1" TagName="permits_expired_dg"
Src="permits_expired_dg.ascx" %>
<%@ Register TagPrefix="uc1" TagName="invoices_webgrid"
Src="invoices_webgrid.ascx" %>
<%@ Register TagPrefix="uc1" TagName="Banner" Src="Banner.ascx" %>
<%@ Register TagPrefix="uc1" TagName="workflow_histories_list"
Src="workflow_histories_list.ascx" %>
<%@ Register TagPrefix="uc1" TagName="agency_correspondence_list"
Src="agency_correspondence_list.ascx" %>
<%@ Register TagPrefix="uc1" TagName="facility_agency"
Src="facility_agency.ascx" %>
<%@ Register TagPrefix="uc1" TagName="tabs_control" Src="tabs_control.ascx"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Notice Detail</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="styles.css" type="text/css" rel="stylesheet">
<script src="javascript.js"></script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table class="mainTableStyle" cellSpacing="0" cellPadding="0"
align="center">
<tr>
<td class="tabsMenu" align="center"><uc1:tabs_control
id="userNavigationBar" runat="server"></uc1:tabs_control></td>
</tr>
<tr class="TabPage">
<td>
<table align="center">
<TBODY>
<tr>
<td class="FieldNameAlign">Facility</td>
<td colSpan="2"><asp:label id="lblFacilityInfo"
runat="server"></asp:label></td>
<td class="FieldNameAlign">Agency</td>
<td colSpan="2"><asp:label id="lblAgency"
runat="server"></asp:label></td>
</tr>
<tr>
<td class="FieldNameAlign" id="tdnoticeIDField"
runat="server">Notice ID</td>
<td id="tdnoticeIdControl" runat="server"><asp:textbox
id="txtAgencyNoticeID" runat="server"></asp:textbox></td>
<td class="FieldNameAlign">
<asp:Label id="lblIssuedDate" runat="server"></asp:Label></td>
<td><asp:textbox id="txtIssuedDate" runat="server"
Width="90px"></asp:textbox></td>
<td class="FieldNameAlign" id="tdReceivedDateField"
runat="server">Received Date</td>
<td id="tdReceivedDateControl" runat="server"><asp:textbox
id="txtReceivedDate" runat="server" Width="90px"></asp:textbox></td>
</tr>
<tr>
<td class="FieldNameAlign" id="tdTypeField"
runat="server">Type</td>
<td id="tdTypeControl" runat="server"><asp:dropdownlist
id="cmbCategory" runat="server"></asp:dropdownlist></td>
<td class="FieldNameAlign" id="tdPenaltyAmountField"
runat="server">Penalty Amount</td>
<td id="tdPenaltyAmountControl" runat="server">$<asp:textbox
id="txtPenaltyAmount" runat="server" Width="64px">0</asp:textbox></td>
<td class="FieldNameAlign">
<asp:Label id="lblDueDate" runat="server"></asp:Label></td>
<td><asp:textbox id="txtDueDate" runat="server"
Width="90px"></asp:textbox></td>
</tr>
<tr>
<td class="FieldNameAlign">Status</td>
<td><asp:label id="lblStatus" runat="server" Font-Bold="True"
ForeColor="Blue"></asp:label></td>
<td class="FieldNameAlign" id="tdNextActionLabel"
runat="server">Next Action
</td>
<td id="tdNextActionDropDown" colSpan="3"
runat="server"><asp:dropdownlist id="cmbNextAction"
runat="server"></asp:dropdownlist></td>
</tr>
<tr>
<td class="FieldNameAlign">Resolution Date</td>
<td><asp:textbox id="txtResolutionDate" runat="server"
Width="90px"></asp:textbox></td>
<td class="FieldNameAlign"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr align="center">
<td colSpan="4"><asp:textbox id="txtDescription" runat="server"
Width="476px" TextMode="MultiLine" Height="70px"></asp:textbox></td>
<td vAlign="top" align="left" colSpan="2"><asp:hyperlink
id="lnkImage" runat="server" Visible="False">Image</asp:hyperlink><BR>
<asp:label id="lblSystemInfo" runat="server"></asp:label></td>
</tr>
<tr>
<td align="center" colSpan="6"><b><u><asp:linkbutton
id="lnkNoticeItems" runat="server">Notice Items</asp:linkbutton>
<asp:LinkButton id="btnViewPermit" runat="server">View
Permit</asp:LinkButton></u></b></td>
</tr>
<tr>
<td align="center" colspan="6">
<uc1:invoices_webgrid id="userInvoices" runat="server"
Visible="False"></uc1:invoices_webgrid>
</td>
</tr>
<tr>
<td vAlign="top" align="center" colSpan="6"><asp:datagrid
id="dgNoticeItems" ShowFooter="True" DataKeyField="SystemNoticeItemID"
Runat="server"
BackColor="#eeeeee" AutoGenerateColumns="False">
<AlternatingItemStyle BackColor="White"></AlternatingItemStyle>
<HeaderStyle CssClass="headerstyledg"></HeaderStyle>
<Columns>
<asp:TemplateColumn HeaderText="Item#">
<ItemTemplate>
<asp:Label ID="lblItemNum" Runat="server"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblItemNumEdit" Runat="server"></asp:Label>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Type">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "TypeName")%>
</ItemTemplate>
<EditItemTemplate>
<asp:dropdownlist id="cmbItemType1Edit" runat="server"
AutoPostBack="True" />
<asp:dropdownlist id="cmbItemType2Edit" runat="server"
Visible="False" />
<asp:dropdownlist id="cmbItemType3Edit" runat="server"
Visible="False" />
</EditItemTemplate>
<FooterTemplate>
<asp:dropdownlist id="cmbItemType1" runat="server"
AutoPostBack="True" />
<asp:dropdownlist id="cmbItemType2" runat="server"
Visible="False" />
<asp:dropdownlist id="cmbItemType3" runat="server"
Visible="False" />
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Description">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "ItemDescription")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtItemDescriptionEdit" TextMode=MultiLine
Runat="server" Text='<%#DataBinder.Eval(Container.DataItem,
"ItemDescription")%>'>
</asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:textbox id="txtItemDescription" TextMode="MultiLine"
Runat="server" />
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Status">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "StatusName")%>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="cmbStatus"
Runat="server"></asp:DropDownList>
</EditItemTemplate>
<FooterTemplate>
<asp:DropDownList ID="cmbStatusNew"
Runat="server"></asp:DropDownList>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Date Resolved">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "ResolutionDate",
"{0:MM-dd-yyyy}")
== "01-01-0001"? "":DataBinder.Eval(Container.DataItem,
"ResolutionDate", "{0:MM-dd-yyyy}")
%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDateResolved"
Runat="server"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtDateResolvedNew"
Runat="server"></asp:TextBox>
</FooterTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Resolution">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem,
"ResolutionDescription")%>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtResolution" Runat="server"
TextMode="MultiLine"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtResolutionNew" Runat="server"
TextMode="MultiLine"></asp:TextBox>
</FooterTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn EditText="Edit" HeaderText="Edit"
UpdateText="Save" CancelText="Cancel"
ButtonType="LinkButton"></asp:EditCommandColumn>
<asp:TemplateColumn>
<FooterTemplate>
<asp:Button CommandName="Add" Runat="server"
CausesValidation="False" Text="Add" />
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid><asp:label id="lblItemError" runat="server"
ForeColor="Red" EnableViewState="False"></asp:label></td>
</tr>
<tr>
<td align="center" colSpan="6"><asp:linkbutton id="lnkAgencyComms"
runat="server" Font-Bold="True"> Correspondence</asp:linkbutton><BR>
<uc1:agency_correspondence_list id="userCorrespondenceList"
runat="server" Visible="False"></uc1:agency_correspondence_list></td>
</tr>
<tr>
<td align="center" colSpan="6"><asp:label
id="lblCorrepondenceError" runat="server" ForeColor="Red"
EnableViewState="False"></asp:label></td>
</tr>
<tr>
<td colSpan="6">
<hr>
</td>
</tr>
<tr align="center">
<td colSpan="6"><asp:button id="btnEdit" runat="server"
CssClass="Button" Text="Edit" CausesValidation="False"></asp:button>&nbsp;
<asp:button id="btnSave" runat="server" CssClass="Button"
Text="Save"></asp:button>&nbsp;
<asp:button id="btnSaveQuit" runat="server" CssClass="Button"
Text="Save &amp; Quit"></asp:button>&nbsp;
<asp:button id="btnBack" runat="server" CssClass="Button"
Text="Back" CausesValidation="False"></asp:button>&nbsp;
<asp:button id="btnCancel" runat="server" CssClass="Button"
Text="Back" CausesValidation="False"></asp:button></td>
</tr>
<tr align="center">
<td colSpan="6"><asp:linkbutton id="lnkHistory" runat="server"
Font-Bold="True">History</asp:linkbutton></td>
</tr>
<tr align="center">
<td colSpan="6"><uc1:workflow_histories_list
id="userWorkFlowHistoriesDG" runat="server"
Visible="False"></uc1:workflow_histories_list></td>
</tr>
</TBODY>
</table>
</td>
</tr>
</table>
</form>
</body>
</HTML>


</pre>
 
Hi David,

can u debug the code and check if you can step inside the event.
if not see there is a event inside

private void InitializeComponent()

{
this.btnViewPermit.Click += new
System.EventHandler(this.btnViewPermit_Click);
}

if its there then its something related to the page you are doing the
server.transfer
 
Hi David,

You can check what Ashish suggested.
Because sometimes VS.NET swallows the delegate in the Initialize which
disables the button click event.
Its a bug i guess in VS.NET

Thanks
Raghavendra
 
I did all that. But right before being able to step in, it prints that
string "true" It happens intermittenly.
 
Back
Top