Problem With A Postback

May 3, 2008



I want that a textbox do a postback after I change the text : I change autompostback to true , It's do a postback after
I press on the enter button , how can I do automatic postback after the text change without press on the enter button?

View 1 Replies


ADVERTISEMENT

Sql Insert And Postback Problem

Mar 20, 2008

Hi.
We have a problem. The sql insert don't work together with postback on the insert button. The following solution has been sugested:Partial Class Login
Inherits System.Web.UI.Page

Protected WithEvents loginButton As Button

Protected Sub loginButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginButton.Click
Response.Redirect("Tunnel1.aspx")
End Sub

End Class
 But it doesn't work (the data is saved in the databse but the page isn't redirected to "Tunnel1.aspx"), why?
Here is the code for the page:<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Login.aspx.vb" Inherits="Login" title="Untitled Page" %>

<asp:Content ID="Main" ContentPlaceHolderID="Main" Runat="Server">
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>"

InsertCommand="INSERT INTO konsult(användarnamn, lösenord) VALUES (@användarnamn, @lösenord)">
</asp:SqlDataSource>

<asp:FormView ID="FormView1" runat="server" DataSourceID="SqlDataSource1" DefaultMode="Insert">
<InsertItemTemplate>

<table cellpadding="0" cellspacing="0" width="100%" border="0">
<!-- Menyrad -->
<tr>
<td colspan="2">
<table align="right" cellpadding="0" width="100%" bgcolor="#EEEEEE">
<tr>
<td align="left">
<script type="text/javascript" language="JavaScript">showMenus(1,'Horizontal')</script>
</td>
<td width="100%" align="right">
</td>
</tr>
</table>
</td>
</tr>
<!-- Sidan -->
<tr>
<!-- Topp skuggor -->
<td width="500" height="15" style="background-image: url('Images/toppskugga_Liten.jpg'); background-repeat: no-repeat; background-position: center bottom">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="20"></td>
<td width="460"></td>
<td width="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<!-- Mellan skuggor -->
<td width="500" style="background-image: url('Images/mellanskugga_Liten.jpg'); background-repeat: repeat-y; background-position: center bottom">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="20"></td>
<td width="460">
<table width="100%">
<tr>
<td width="150">Användarnamn:*</td>
<td width="250"><asp:TextBox Width="150" ID="användarnamnTextBox" runat="server" Font-Size="X-Small" Text='<%# Bind("användarnamn") %>' /></td>
</tr>
<tr>
<td width="150">Lösenord:*</td>
<td width="250"><asp:TextBox Width="150" textMode="Password" ID="lösenordTextBox" runat="server" Font-Size="X-Small" Text='<%# Bind("lösenord") %>' /></td>
</tr>
<tr>
<td width="150">Upprepa lösenord:*</td>
<td width="250"><asp:TextBox Width="150" textMode="Password" ID="upprepalösenTextBox" runat="server" Font-Size="X-Small" Text="" /></td>
</tr>
</table>
</td>
<td width="20"></td>
</tr>
</table>
</td>
<td rowspan="3" width="240" valign="top">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="240" align="right">
 
<asp:Button ID="loginButton" CommandName="Insert" CausesValidation="True" runat="server" Text="Spara" />
 
</td>
</tr>
<tr>
<td width="240" style="background-image: url('Images/toppskugga_Mini.jpg'); background-repeat: repeat-y; background-position: center bottom"> </td>
</tr>
<tr>
<td width="240" style="background-image: url('Images/mellanskugga_Mini.jpg'); background-repeat: repeat-y; background-position: center bottom">
<table>
<tr>
<td width="20"></td>
<td width="200" valign="top">
<asp:CheckBox ID="CheckBox1" runat="server" Text="Jag godkänner att mina personuppgifter registreras enligt PUL." />
</td>
<td width="20"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="240" style="background-image: url('Images/bottenskugga_Mini.jpg'); background-repeat: repeat-y; background-position: center bottom"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<!-- Botten skuggor -->
<td width="500" height="20" style="background-image: url('Images/bottenskugga_Liten.jpg'); background-repeat: no-repeat; background-position: center bottom">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="20"></td>
<td width="460"></td>
<td width="20"></td>
</tr>
</table>
</td>
</tr>
</table>

</InsertItemTemplate>
</asp:FormView>
</asp:Content>

 

View 2 Replies View Related

Sqldatasource Weirdness On Postback

Jan 7, 2006

If I alter the SqlDataSource select command in code and then bind to a gridview, I run into problems. When I do a sort, next page (basically any postback), the datasource goes back to the original state. It is like the SqlDataSource is not maintained in the  state. I end up having to re-alter the SqlDataSource select command on every page_load. Is this by design or is this a bug?
Is the SqlDataSource any "smarter" than doing it the old fashion way by populating a Dataset on (!IsPostBack) ? For example, if I have a bunch of data in a paged gridview, is the SqlDataSource smart enough not to bother filling the entire dataset if I don't need it for that page's display?  I know the SqlDataSource provides for update/insert/delete, but I am not doing that in this application, it is just a query/report page.
Thanks in advance

View 4 Replies View Related

PostBack While Selecting A Parameter

Mar 21, 2007

Hi,

I'm working on a report having 2 date parameters(which uses calendar control) and a dropdownlist. But on selecting each of these parameters, the page refreshes. For eg On selecting a date from the calendar control results in a postback. The same is the case with the dropdownlist. Could you please help to resolve this issue? We need the postback to happen only on clicking the 'View Report' button.

Also, is there any way to customize the 'View Report' button. It always appears in the right hand side. Can we set the position of this button so that it appears just below the paging button?

Thanks in advance,

Sonu.







View 1 Replies View Related

Postback Causing Database Transactions To Replay

Dec 7, 2006

Hey,
 I hope someone can quickly tell me what I am obviously missing for this weird problem. 
To give a general picture, I have an ASP.net webpage that allows users to select values from several dropdown menus and click an add button which formats and concatenates the items together into a listbox. After the listbox has been populated the users have the option to save the items via a save button.
The save button parses each item in the listbox to basically de-code the concantenated values and subsequently inserts them into a table residing on a backend MSSQL 2005 database.
PROBLEM:
In the process of testing the application, I noted this strange behavior. If I use the webpage to insert the values, go to the table where the values are stored and delete the rows; Upon a refresh of the web page the same actions seem to be getting replayed and the items are again inserted into the table.
Naturally, what I'd really like would be for the page to refresh and show that the items aren't any longer there and not the other way around. 
If the code that performed the insert was residing in a component that was set for postback I'd expect this type of behavior but its in the Save buttons on_click event. I have tried practically everything in effort of targeting the problem but not having much luck with it.
Is this behavior practical and expected in ASP.net or has anyone ever heard of anything similar? I have never encountered this type of problem before and was hoping someone could provide some clues for resolving it. If more information is required I'd be happy to supply it. Hopefully, there's a simple explanation that I am simply unaware since I haven't experienced anything like this before.
Anybody got any ideas???
Thanks.

View 6 Replies View Related

Changing Default Parameters Cause Postback Efresh

Jul 26, 2006

I think it has been discussed previously that having default parameter values based on expressions, e.g. a default parameter value of =Split("Bug",",") in multiple parameters will cause a postbacl whenever a user selects different values from the list.

Is this by design? Its a bit of an annoying thing. The refreshpostback doesnt happen if you have basic defaults like ="All" but only when an expression of some sort is used in more than 1 parameter. Does RS think they are linked or something, why does it need to psotback
efresh?

View 23 Replies View Related

How To Persist Title Of 'modal Dialog' During Postback

Oct 18, 2007

Hi,

Please give me some idea to persist or set title of modal dialog during postback.

The title of modal dialog is going lost whenever postback happen on modal dialog.

document.title is not working after postback.


Thanks,
Sandeep, India

View 1 Replies View Related

Prevent Date Parameter Button From Postback

Jan 21, 2008

Hi Everyone-

i have a report that include a parameter of type date and it is visible to the user in order to choose the date and submit view report button to rendering the report.



i don€™t know if it is a bug in SSRS or not

but the problem is that if the user try to click on the date button of the parameter and choose a date

And then try to click again on the date button and choose a date another date .....after repeat the previous step more than one time the page is post back and reset the report and this not desirable by our client



Note:


Again the date button I am mention is the date button that auto generated by the SSRS as there is a parameter of type date

This Case happen only if the report run through a browser





Thanx

Maylo

View 1 Replies View Related

Display The Evaluated Expression Automatically Before PostBack

Apr 28, 2008


I have a report which includes two fields of type date pFromDate and pEndDate.
My pFromDate Available values is 'No-queried', and Default values is 'Null'.
My pEndDate values is 'No-queried', and Default values is the
expression '=DateValue(Today)'.
After I upload my report to the report server and run it pEndDate is disabled until I choose value to pFromDate and a postBack occurs.
I want pEndDate display the evaluated expression automatically when I run the report.
How can I do it? Thanks in advance.

View 1 Replies View Related

Sqldatsource:SelectParameters:FormParameter Not Effective Till Postback?

Nov 14, 2007

I have a simple gridview that loads on page load. It uses an on page sqldatasource declaration in which there's a parameter in which value is already available in cookies. I added an asp:HiddenField and set that value on PageLoad() to the value of the cookies. I then set a FormParameter in the sqldatasource mapped to that hidden field. However that appears to have no effect at all. I'm guessing the sqldatasource will only use the form field after postback.

View 2 Replies View Related

Postback Issue While Selecting Parameters In SQL Reporting Service

Sep 5, 2007

Hi,

I am working on a report (in 2005 version) having 6 date parameters ( which uses calendar control). When on selecting the date parameter(except the last data paramenter), the page refreshes. For eg On selecting a data from the calendar control results in a postback. but if I select the last data paramenter, the page is not refreshed.

I did another test on a report that only has 2 data paramters (use the calendar control), it is the same. you select the second the data parameter, no postback happened, but if you select the first data parameter, the postback happened.


Dose anybody know what is the issues? We need the postback to happen only on clicking the 'View Report' button.


Thanks in advance,
TH

View 3 Replies View Related

Sqldatasource Setting Reset After Page Postback, Could Anyone Give Me A Hand On This

Nov 25, 2005

Hi, I have created a search page which needs to perform different
search function in same page. I have setuped a sqldatasource then
manual
setup the connection string and command inside the codefile. So the
select command can be various depends on the event. The problem is
all of those setting will be reset after I click on the pageindex in
the girdview control to go to next pages. Since this gridview is linked

with this sqldatasource control, I need to restore the connection
string/command when user choose decide to view next page of data inisde
the
gridview.

I think I must have done something wrong in here becuase it will end up
retrieving  the total amount of data when everytime user choose to
view next
or perivous page.

Can someone give me a hand on this ? Thanks

View 1 Replies View Related

Need Help W/ Postback To 'Customers' Table On Form Using Select Query From 'Parameters' Table

Dec 20, 2007

I have set up a 'Parameters' table that solely stores all pre-assigned selection values for a webform. I customized a stored query to Select the values from the Parameters table. I set up the webform. The result is that the form1.apsx automatically populates each DropDownList task with the pre-assigned values from the 'Parameters' table (for example, the stored values in the 'Parameters' table 'Home', 'Business', and 'Other'  populate the drop down list for 'Type').
The programming to move the selected data from form1.aspx to a new table in the SQL database perplexes me. If possible, I would like to use the form1.aspx to Postback (or Insert) the "selected" data to a *new* column in a *new* table (such as writing the data to the 'CustomerType' column in the 'Customers' table; I clearly do not want to write back to the 'Parameters' table). Any help to get over this hurdle would be deeply appreciated.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved