Page Enter Page_PreInit event Over ten times

Stimulsoft Reports.WEB discussion
Post Reply
a.ebbini
Posts: 101
Joined: Thu Jun 05, 2014 8:10 am
Location: Jordan

Page Enter Page_PreInit event Over ten times

Post by a.ebbini »

I had a problem when i put StiWebViewer to any WebForm the behavior of the page go strange it will enter Page_PreInit event over 10 times the problem i have some code must be put it in PreInit event so how can i avoid this behavior
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Page Enter Page_PreInit event Over ten times

Post by Vladimir »

Hello,

Please try to use the following code:

Code: Select all

    protected void Page_PreInit(object sender, System.EventArgs e)
    {
        if (Page.Request.QueryString.ToString().IndexOf("stimulsoft_") < 0 && Page.Request.QueryString.ToString().IndexOf("sr_") < 0)
        {
            var str = string.Empty;
            // Some actions
        }
    }
Thank you.
Post Reply