.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

refreshing a page cause an issue

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

Hiii coders,

I have a button on my aspx page on clicking which i get a new enquiry no in my textbox. It is working very much fine.

But problem is that even when i refresh my page, it will get a new enquiry no.

I only want a new enquiry no to be displayed in textbox whenever i click on button.

This is my c# code for button_click event-

protected void Button1_Click(object sender, EventArgs e)
        string sql_qry2 = "select dbo.FN_GET_ENQ_NO()";
        Class1 c2 = new Class1();

plz resolve this issue asap

thanx and regards

View Complete Post

More Related Resource Links

Master Page css linking issue

I'm having an issue with my css file linking to one of my nested master page.This is the general setup of my site:Root-RootMaster.master--Dir1---Dir1Master.master---Dir1Style.css--Dir2---SubDirA----Dir2Master.master----Dir2Style.cssI have a content place holder in the <head> of the RootMaster.master so that I can specify a css file for each nested master page.  I have Dir2Style.css linked in Dir2Master.master, and it works both in the designer and on the site for all content pages.  It's linked like so:<link href="Dir2Style.css" rel="Stylesheet" type="text/css" />However when I link Dir1Style.css to Dir1Master.master, it is only linking correctly in Visual Studio.  Whenever I open a content page in that directory using that master it doesn't apply the css.  I've also tried dragging and dropping the css file onto the page so that it sets up the path itself, and it still won't work.  The only way I've been able to get it to show correctly on the site is by doing a <% ResolveUrl() %> for the href, but then it doesn't work in the designer.  Any ideas on why it's working for one and not the other?  Both the nested master pages are set up the exact same except for the css link...

AutoPostback in Repeater in UpdatePanel is refreshing the page

Here's quite a weird problem:I've got a TextBox with AutoPostBack="true" and OnTextChanged property set.The textbox is located inside a Repeater, which in turn is located inside an UpdatePanel.Problem is - whenever the TextBox postsback, the whole page gets reloaded, instead of the UpdatePanel only.Here's how the thing looks:<asp:UpdatePanel runat="server"> <ContentTemplate> <asp:Repeater ID="itemsRepeater" runat="server"> <HeaderTemplate> <ul class="lstProducts"> </HeaderTemplate> <ItemTemplate> <li> <asp:TextBox AutoPostBack="true" OnTextChanged="whatever_Click" runat="server" /> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </div> </ContentTemplate> </asp:UpdatePanel> Interesting thing is, if I take the TextBox out of the repeater, it refreshes only the UpdatePanel.So is if I put a Button inside the repeater - only the UpdatePanel gets refreshed.But whenver I place an AutoPostBack-ing control inside the Repeater, the whole page gets refreshed.Any help would be welcomed,Thanks<asp:UpdatePanel runat="server">             &

Page Refresh Issue

Hi All,   My web application is on .NET 1.1 using C#. Page is not getting loaded properly, need to refresh page couple of times then the desired functionality works. Let me how to resolve this problem. Was trying to refresh with javascript but not able to write javascript it was getting into loop, page was continuously refreshing.   Let me what coluld be the reason for page not getting worked as expected, only works when page is refreshed. Let me know what what could be the issue, is it server issue where the application is. One more thing application works fine on my local machine when deployed to other TEST envrionment, it does not work.   Please help me on this.   Thanks Abdul 

SSIS And Sybase Source OLEDB connectivity issue with code page for character set

Hi I am using SSIS 2008 to connect the Sybase Server version 15.0.3 64-bit. The default character set id used by this Sybase server is 4 (i.e. roman8). (http://manuals.sybase.com/onlinebooks/group-charc/chg0300e/charsets/@Generic__BookTextView/1706;pt=266) I had installed Sybase Client for Sybase OLEDB Driver (ASEOLEDB) to integrate this in OLEDB Source Editor. As per guidance from one of the past MSDN forum discussion, I tried setting property of AlwaysUseDefaultCodePage property to "FALSE"  (http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/f5af9328-e1fb-48d7-a85d-1d08bb7cf0e5/). However, I am still experiencing error message as follows:- ********************************************************* Error at Package2 [Connection manager "xxxxxx.xxxxxxx"]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: "ASEOLEDB"  Hresult: 0x80004005  Description: "[00000] [Native Code: 30061] [ASEOLEDB]Could not load code page for requested charset". An OLE DB record is available.  Source: "ASEOLEDB"  Hresult: 0x80004005  Description: "[1ZZ001] [Native Code: 30016] [ASEOLEDB]Internal Error". Error at Data Flow Task 2 [OLE DB Source [1]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMC

Issue inserting to database on submit the page goes blank

Hi guys,I'm new to asp.net, can someone please help me with this. I'm trying to insert few values to a table, when i press the submit button the aspx page goes blank and i don't get any error message. I'm not able to find where the error is.The code:Protected Sub AddMInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddMInfo.Click Dim dbsource As SqlDataSource dbsource = New SqlDataSource         dbsource.ConnectionString = ConfigurationManager.ConnectionStrings("dbConnectionString1").ToString         dbsource.InsertCommandType = SqlDataSourceCommandType.Text         dbsource.InsertCommand = "INSERT INTO db_mdl_info(dlprodid,dlmdlid,dlbrnd,dlmdlnm,dlmdlnbr,dlcpst,dlprsr,dlmxm,dlmim,dlmslt,dlmxps,dlmtpe)" &                                 "Values('" & DropDownList2.Text & "','" & DropDownList3.Text & "','" & MakeTextBox.text & "','" & DropDownList2.SelectedItem.Text &                                 "','" & MNoTextBox.Text & "','&quo

Page should not be Refreshing

Hi I have a dropDownList on a page that I need to refresh with new database entries whenever new content is added to my DB. Basically, I have a list of usernames in one dropdown, and when I add a new username to the database I want this to be reflected in the dropdown without refreshing the whole page i.e. on the fly. I have  used update panel but partial postback is occuring but i want page should not refreshing at all I hope someone can help, I have looked around and not found any solutions. Thanks in advance.

Detecting a page close using GetCallbackEventReference IIS6/IIS7 Issue

I have a popup page that when closed,  initiates a server side function that updates a DB table.  After looking at countless posts, I was able to use the following code (partial) to generate the callback when the window closes. The problem I'm having is that it works great on a server with IIS7, but the event doesn't fire on one with IIS6. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load    If Not IsPostBack Then        Dim callBackReference As String = Page.ClientScript.GetCallbackEventReference(Me, "arg", "LogOutUser", "", True)        Dim logOutUserCallBackScript As String = "function LogOutUserCallBack(arg, context) { " & callBackReference & "; }"       Me.ClientScript.RegisterClientScriptBlock(Me.GetType(), "LogOutUserCallBack", logOutUserCallBackScript, True)    End If  End Sub      Public Function GetCallbackResult() As String Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult               Return _callBackStatus    End Function     Public Sub RaiseCallbackEvent(ByVal eventA

DataEntry: Refreshing Page re-enters same data again.

Hi,I have a simple page, 2 textboxes & 1 button, wherein when button is clicked the values in both textboxes are added to a database table. code works however, when button is clicked the values are still in the textboxes. I created txt1.text = vbnullstring & txt2.text = vbnullstring after Myconnection.Close() just to delete the values in the textboxes.but when I try to refresh my page, The values are still added to my table. I could redirect to a new page after a successful entry but, I just what to add a label saying "New Entry Added", clear the textboxes and waits for a new entry.How do i do this?Regards,

My Grid is not refreshing like it should. It only refreshes through a hard refresh of the page (F5)

Here is the code. I have Javascript in there that runs after the save button on the ExtJS popup is clicked, that is supposed to  refresh the grid to show the uploaded files, but the grid will SOMETIMES show nothing, and sometimes show the files. It ALWAYS shows  the files after a hard refresh of the page (F5). Why is it doing this? <br/> <br/> <%@ Page Language="VB" Inherits="Web.BaseView(Of Lending.Controllers.Workspace.DocumentUploadData)" %> <%@ Import Namespace="WebControls.Forms" %> <%@ Import Namespace="WebControls.Grids" %> <script runat="server"> </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title>     <script language="javascript" type="text/javascript">         function RefreshGrid(result, data) {             if (data.responseText.length > 0) {                 var obj = eval('(' + data.responseText + ')');                 if (obj.Result == false) {                     Global.alertError(obj.UserM

refreshing (reloading) the self page when it opens the popup window

silbut = e.Item.FindControl("button4")         silbut.Attributes.Add("onclick", "window.open('firmaus.aspx?i=" + rrid.Text + "&s=" + Session("firma").ToString + "')") Hi all,I add an attribute on data bound event to the datalist with following codein studentlist.aspx page :deletebutton = e.Item.FindControl("button4")deletebutton.Attributes.Add("onclick", "window.open('studentus.aspx?i=" + rrid.Text + "&s=" + Session("studid").ToString + "')")but i want deletebutton to refresh parent page (studentlist.aspx) when i click it, with openning the page (studentus.aspx...)how can i add this attribute?thanks for helps.

SSRS page break issue

Hi, I am using SSRS 2005. I have developed a SSRS report which prints multiple invoices, having invoice numbers and the parameters. The report is printing multiple invoices having page break after each invoice ends. But there is a header and body section. The body section contains the line items. The issue is after the header part the body part is moving to the next page for some invoices. When the line items are less, it is printing contineously after the header. If the line items are more the whole body is moving to the next page. When I try to fix this issue, some records are printing in the same page of the header and only last record is printing in the next page leaving a long blank in the first page of the invoice. I appreciate any one can solve this issue and it will be really helpful in solving this issue. Thanks , Mahalingam

SSRS Report issue blank page is coming

I have a report with 2 pages, some time the second page doesnot contain the data at that time i want to get only 1 page report. but as of now if second page does not have data it is coming as blank, can anyone help on this. I am using ssrs 2008Jeeva Jacob

Login Page issue with the Banner



I'm using Visual Web Developer 2010 Express.

I've published the application however when I view the login page the banner is not displayed I just get the red x.. It's fine in pages in other folders but not the Login page which sits in the Account folder however I'm getting the menu so it seems to be picking up the master page.

I've added the image to the Account folder but it just wont show, any ideas?





<%@ Page Title="Log In" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Login.aspx.vb" Inherits="PODPortal.Login" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        Log In
        <asp:HyperLink ID="RegisterHyperLink" runat="server" Visible="false" Enab

Permission issue - users not seeing correct master page and css


I have started playing with permission and created a whole that I can not climb out of! Any help will be great!!! Here are my issues:

1. (this one started it all) I added an approval workflow to a library with the thought that a doc would not show to the public until it is approved. Ain't happening...what do I have to do for this process to work?

2. In trying to solve the above I restricted nt auth to the visitors group and then made that group read only. Now members of the visitor group only sees the old master page and css. The only way to fix it so far is to add nt auth to the owners group. that won't fly.


Neatupload refreshing page after upload is complete


I hope someone can help with this.

After the upload completes the page refreshes. I'm using a LinkButton to activate the upload.

Is there anything I can do to prevent this?

Sharepoint 2007 Minimal Master Page Picture Library Thumbnail and FilmStrip issue



If i use custom master pages. For some reason a user cannot view the thumbnail or filmstrip view;  only the details view will display. No errors are thrown when a user selects the filmstrip or thumbnail view, in fact nothing happens at all.

If the master page for the site is changed to default.master then the picture library functionality returns.

Anyone can help me in this. Thanks in advance.

Request is redirected to default Web-Service page (possible cookie issue)


I have a strange problem on my web-service application:
 - when I am initating a web-service request from my client app, no matter if I am using IIS or ASP.NET development server, I'm getting the folowing exception:


System.ServiceModel.ProtocolException: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '


    <head><link rel="alternate" type="text/xml" href="/TestWebSvc.asmx?disco" />

    <style type="text/css">
        BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; }
        #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; }


 - in my client's app.config file I have pointed to an address like the following one: http://localhost/WebSvc/TestWebSvc.asmx .

 - I have installed SnifferHttpModule (http://geekswithblogs.net/robp/archive/2008/05/13/creating-a-sniffer-for-asp.net.aspx) to see the requests and responses of my web-service,
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend