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

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

SQLDataSource and PostBack Problem

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :ASP.Net

Hi to everyone.

i am new to ASp.Net and got some problem in Postback.

I placed a text box and a button master page for searching the site contents from the database.

i have set the postback url of asp button and on search page i got value of text box to be searched. at this point i have the following problems

  1. how to pass the value of text box to sqldatasource.
  2. when i navigate from the home page to search page then i got the value of text box (placed in the master page),, but when i enter some new text in the box and press search button the i could not get the new text box value.

any suggestions.

sorry for poor englis.

View Complete Post

More Related Resource Links

page postback problem with crystal report


Hi , i am creating crystal report with asp.net it is working showing data but  data is of two page its is take round trip action but report is not show 
until again i click on show button in this it is not propersly showing that data is how.

<br />
    <asp:Button ID="btnShow" runat="server" OnClick="btnShow_Click" Text="Show Report" />
<CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" DisplayGroupTree="False" EnableDatabaseLogonPrompt="False" /> CrystalReportViewer1.ReportSource = null; SqlCommand cmd = new SqlCommand(strcmd, c.con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); ReportDocument doc = new ReportDocument(); doc.Load(AppDomain.CurrentDomain.BaseDirectory + "\\rptQuotation.rpt"); doc.SetDataSource(ds.Tables[0]); // login info SqlConnectionStringBuilder csb = new SqlConnectionStringBuilder(ConfigurationManager.ConnectionStrings["conStr"].ConnectionString); TableLogOnInfos crtableLogoninfos = new TableLogOnInfos(); TableLogOnInfo crtableLogoninfo = new Tabl

Problem with UpdatePanel postback

Hello,I have a Modal Popup window, inside an Update Panel object, that has the following layout:A Title areaA Content area with a tabstrip of 5 tabsA footer area with two buttons (Save and Cancel) and an UpdateProgressIn 3 of the five tabs I have:an UpdatePanel (UpdateMode=Conditional) that wrapsA collection of LinkButtons objectA gridviewAnother Panel object to be showed as a Nested Modal PopupNO update ProgressBoth the link collection and the gridview Select event will open the nested Modal window that contains a custom Usercontrol that is used to add new or edit object of the related gridview like in the code sample below//click handler of the LinkButton protected void btnNewPhone_Click(object sender, EventArgs e) { //Setup properties of the UserControl code omitted // ... //Show the nested Popup this.mpePopupPhone.Show(); } //handler for the gridview selectedIndex event protected void gvPhones_SelectedIndexChanged(object sender, EventArgs e) { //Setup properties of the UserControl code omitted // ... //Show the nested Popup this.mpePopupPhone.Show(); } Please note that: I am using the ModalPopupExtender show/hide behaviors using only server-side code. Also, the ModalPopupExtender objects for nested modal windows does not have the OkControlID & CancelControlID set. As the content of nested modal window is only a single user contro

Problem with custom onBeginRequest-Handler on client-side when partial postback is triggered from ja

Hi, I have a Modal Dialog with a Ribbon, which starts a long running serverside operation. To inform the user about the progress, I implemented Dino Espositos "Progress Monitor Framework", which worked perfectly (after some work) - at least when I trigger the partial postback from a control inside the UpdatePanel used for displaying the progress. In this approach custom onBeginRequest and onEndRequest-Handlers are used to start and stop displaying the current status of the serverside operation. When I start the operation from a Button on the ribbon by doing "something" with the mentioned control via javascript the serverside operation is started, but my onBeginRequestHandler ist not called and the progress monitor is not "switched on" on the client. Here is what I´m doing in my javascript :  function pageLoad() { progressManager = new VCSharePoint.MultiEdit.Progress(); // Remove existing handlers Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(onBeginRequest); Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(onEndRequest); // Register handlers for UpdatePanel client events Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(onBeginRequest); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest); } // onBeginRequest() // Called w

gridview viewstate (size around 1.75Mb on each postback) very serious problem

i am developing a a web application of a general store where the operator has to enter the things what cutomer has purchased..like daily useage item,or anyhing ..so i have form in which i first ask how much item u wanna regsiter...(if he has 20-30 number of items then operator will eneter 20-30 then in gridview 20-30 item are opened...with bind dropdownbox containing name of item ,then textboxs containing mrp,value,stock avail of that item .here is the link for demo... http://iconsoftech.com/mahajan/grid/gridview_test.aspxproblem is suppose the operator enter the value above 20.. then then viewstate size id about 1.50Mb thats too heavey please suggest me solution for this problem..<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gridview_test.aspx.cs" Inherits="gridview_test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label4" runat="server" Text="Enter No. Of Products"></asp:Label&g

Postback Problem using Lightbox with DropDownList


Hi all,

I have two sites: "Default.aspx" and "mySubsite.aspx". In "Default.aspx" I have a hyperlink to open a lightbox window, which works perfectly.

Here is the code for it:

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
<a href="mySubsite.aspx" class="lbOn">Open Lightbox Window</a>

When the lightbox window opens("mySubsite.aspx.cs") I placed two drop down lists ( parent child use) . First DDL contains all the parent names and the second DDL returns the subname to the corresponding parent name. So basically I select a parent item and get the right subname for it.

Code for it looks this way.

protected void Page_Load(object sender, EventArgs e)

if (!IsPostBack)
DDLParent.DataSource = data_string;


protected void DDLParent_SelectedIndexChanged(object sender, EventArgs e)

prevent postback javascript problem


i have the following example but i get error on GetPostBackEventReference line

value of tpe ...button cannot be converted to....

second question:where should i put this code? do i need just this code and nothing else

how should i for example delay for 20 seconds??

Dim sb As New System.Text.StringBuilder()
            sb.Append("if (typeof(Page_ClientValidate) == 'function') { ")
            sb.Append("if (Page_ClientValidate() == false) { return false; }} ")
            sb.Append("this.value = 'Please wait...';")
            sb.Append("this.disabled = true;")
            Me.btnAddPhotoComment.Attributes.Add("onclick", sb.ToString())



Help. Double-postback problem in different problem. Toggle buttons.


I am using a toggle button and when a button is clicked, the CSSclass is changed by checkign whether it is a 1 or 0.  if it is a 1(on) , it will be set to 0, if it is a 0, it will be set to a 1.

Only 1 postback occurs on each click , and thats how a button is toggled on or off.  In Internet explorer, this is working great.  However, in FireFox and in Google Chrome, something odd is happening!  When I click teh buttons, it is causing a double-postback.  This double-postback cancels out the first postback which was to turn on the button.

Anyone know why my code is causing a double postback?


Modal Popup Extender postback problem?



When i try to submit the page which has modal popup extender,popup extender becomes visible! How can i avoid this?

Thanks in advance.

Problem with checkboxlist, SQLDataSource



I am having some trouble getting a SPSqlDataSource to work, i've used this class plenty of times before and never ran into this problem before. The annoying thing is that i got it to work, no problems at all. So a keeped on writing a few lines of code, and when i ran the code, the page errored. No big deal, so i commented out all the code i writen after when i got it to work, and was quite surprised when the same error appeared, even though the same code worked previously.

So, here is the code:

 SPSqlDataSource GroupMembers = new SPSqlDataSource();
  GroupMembers.ConnectionString = "Data Source=SBSHP\\SHAREPOINT;Initial Catalog=WSS_Content_adfb096a-dfdb-4a41-a71f-a8debd660e4b;User ID=CustomConnections;Password=hemligtlösenord";
  GroupMembers.SelectCommand = "SELECT * FROM CustomGroupsMembers WHERE ID = '" + DropDownList1.SelectedValue + "'";
  CheckBoxList1.DataSource = GroupMembers;
  CheckBoxList1.DataTextField = "ID";
  CheckBoxList1.DataValueField = "ID";

And this is what the design looks like:

<asp:SqlDataSource runat="server" id="SqlDataSource1" ProviderName="System.Data.SqlClient" ConnectionString="Data Source=SBSHP\SH

Update Panel Postback Problem?



Related to my previous question which is answered. The deal is, there is an update panel for modalpopup extender that is triggered by a button. The problem is when the form is submitted by a button, this modal popup is seen on the page! I do NOT want this modal popup extender to be seen when the form is submitted.

Any help please?

Thanks in Advance.

Best regards.

<asp:Label ID="lblPopupTargetID" runat="server" Style="display: none;"></asp:Label>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lblPopupTargetID"
PopupControlID="Panel1" BackgroundCssClass="modalBackground" DropShadow="true" />
<asp:Panel ID="Panel1" runat="server" CssClass="modalPopup" Width="600px">
<asp:UpdatePanel runat="server" ID="UpdatePanel1">

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

jQuery live() and ASP.NET Ajax asynchronous postback

The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens't happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won't be automatically available after the asynchronous postback is over. I underline "automatically" here because my last post describes more possibilities, how this issue can be worked around.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.

Virtual Path Problem


 I get the following error on last line below (working on remote host): 'E:\web\sfcascom\ls_admin/uploads/images/001.JPG' is not a valid virtual path,

Note that the slashes go in different directions

I've tried a number of things but nothing seems to work. Thanks-


Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Drawing.Imaging
Imports System.Web.UI.WebControls

Imports System.Drawing.Imaging.ImageCodecInfo
Partial Class Protected_imageupload
    Inherits System.Web.UI.Page
    Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
        ' Initialize variables
        Dim sSavePath As String
        Dim sThumbExtension As String
        Dim intThumbWidth As Integer
        Dim intThumbHeight As Integer
        Dim sFilename As String = ""
        ' Set constant values
        'sSavePath = "images/"
        sSavePath = Server.MapPath("~/") + "ls_admin/uploads/images/"

        sThumbExtension = "_thumb"
        intThumbWidth = 160
        intThumbHeight = 120

        ' If file field isn?t empty
        If FilUpload.PostedFile IsNot Nothing Then
            ' Check file size (mustn?t be 0)
            Dim myFile As Http
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