Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 99375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:22:31+00:00 2026-05-11T00:22:31+00:00

Good day, I’m having a problem with asp.net 2.0 viewstate. Basically, I want to

  • 0

Good day,

I’m having a problem with asp.net 2.0 viewstate.

Basically, I want to disable the viewstate for a gridview. However, when I do so, as soon as there is a post-back, before even getting into Page_Load, I get a ‘Login failed for user sa …’.

If I enable the viewstate back, everything runs smoothly.

In PageLoad, I set the connection strings to all the SqlDataSource, but as I said, the error comes even before the PageLoad.

In PageLoad, I tried to do something like : MyGridView.DataSourceId = ‘MySqlDataSource’ but with no luck. I’m running out of ideas.

Any idea?

Thank you!

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T00:22:32+00:00Added an answer on May 11, 2026 at 12:22 am

    You have to do it earlier in the page lifecycle.

    If you are developing an ASP.NET website and don’t understand the page lifecycle, RUN, DO NOT WALK, and read this:

    http://msdn.microsoft.com/en-us/library/ms178472.aspx

    Try setting the data source during the Page_Init event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day! Despite the fact LINQ2SQL and ADO.NET Entity Framework exists there were situations
Good Day, We have migrated our web application to ASP.NET 2.0 from ASP.NET 1.1.
Good day! I want to add and remove CSS files according to the size
Good day, I am having an issue trying to get the Text on a
Good day everybody! Having the following code: template<typename T, typename OutStream = std::ostream> struct
Good day! I want to show all the pictures in the folder, but this
Good day. Having read about Model 2 architecture I got confused about some points.
Good day everybody, I want to make an if conditional with the following aim:
Good day, Does anyone know if there is a way to determine when all
Good day! I am trying to disable access on pages that are not part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.