?
Solved

postback SqlDataSource

Posted on 2009-07-07
3
Medium Priority
?
556 Views
Last Modified: 2013-12-17
I am using the following ASP to connect to my database and populate my FormView.

I only want to do this when the page  is  NOT postback. How can I do this?

Here is the asp

 <asp:SqlDataSource ID="PeerAssementDB" runat="server"
        ConnectionString="<%$ ConnectionStrings:ReferralConnectionString %>"
        SelectCommand="spGeteerReviewMonthlyAll" SelectCommandType="StoredProcedure"
        UpdateCommand="spUpdateeerReviewMonthly" UpdateCommandType="StoredProcedure">
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList_SpecDescription" Name="Spec_Desc"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList_Status" Name="Status"
                PropertyName="SelectedValue" Type="String" />
            <asp:QueryStringParameter DefaultValue="P8" Name="OrgCode"
                QueryStringField="OrgCode" Type="String" />
        </SelectParameters>
0
Comment
Question by:Mr_Shaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
muktou earned 2000 total points
ID: 24795794
The Sql Datasource should bind at run time. When the page is not postback then you can bind SQL database with the formview in page load event. like

Page_Load()
{
If(Page.IsPostBack)
{
formview1.DataSource = SQLdatasource1;
formview1.Databind();
}

0
 
LVL 1

Expert Comment

by:muktou
ID: 24795805
formview1.DataSource = SQLdatasource1; please igore this statement and use following statement:

formview1.DataSource = "SQLdatasource1";
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31600672
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question