Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










Web Forms :: At Initial Page Load Start A Thread


I have an application that initially display 4 grid views at page load. This process takes 50-60 seconds and I would like to change the process to display the web page, show message like "Data being loaded, please wait..." and then spin off a thread that fills the various grid view. When this is done I would programatically like to do a post back to show the result. Not sure if this is possible? I tried something like this:

[Code]....


View 1 Replies (Posted: Jun 17, 2010 01:09 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Create A 'thread' To Execute A Function On Page Load / Application Start?
I need to call a function everytime a visitor visits one of my website's page. But I do not want the execution of the function to interfere with the interface between the user and the website i.e. different thread. What is the best way to do that on ASP.Net?

Posted: Jan 10, 2011 03:27 PM

View 3 Replies!   View Related
Web Forms :: Initial Page Load Slow On Each Page Within A User Session?
I am trying to solve a problem with a website I look after which is proving a bit tricky!

Problem is this:

1) User visits page A for the first time in a new session, page load is far from satisfactory

2) Same user, within the same session visits page B - Again, load time is poor

3) Same user, within the same session visits page A again, page load is much, much better, ditto for page B

4) User closes browser, starts again - Page load times are slow again

Home page total size, including images, JS, HTML: 350kb - Not exactly slim, but not enough to be causing the slow load time

I did think this was something to do with SSL, so switched off SSL and restested - The behaviour was exactly the same.

I also thought perhaps this was a DNS problem, but this doesnt make sense - Surely the problem would then only exist for the first page viewed (I am assuming a DNS lookup doesnt occur on every HTTP request!)

I know this may not be a ASP.Net related issue, but then again, fair chance it could be, hence posting here.

Posted: Oct 30, 2009 02:53 PM

View 2 Replies!   View Related
Load Image On Initial Load Of Page
I have a set of thumbnails on a webpage that in the order of 3x3. Next to that set of thumbnails is one update panel. Each thumbnail image is attached to an imageclickeventhandler. Once clicked, the update panel updates with the larger image. That works fine but right now, I'm trying to get the update panel to load the first thumbnail image on the initial load of the page instead of having a blank area. Anyone have any ideas on how this could be done?

Posted: Mar 19, 2009 02:28 AM

View 2 Replies!   View Related
Forms Data Controls :: Formview Modes On Initial Page Load
I a formview object. I have created an edit temple and an empty template Whehn there is data in the table nor probem When my table is empty i got the empty template to display when I click insert I get the error " Form must be in insert mode" How can I tell if there is no data on the page load so I can maybe do this:

formview.f1.defaultmode = fornviewmode.insert

Posted: Apr 13, 2010 04:36 PM

View 5 Replies!   View Related
Slow Initial Page Load
I'm writing a simple web site using codebehind for each page, however using the "codefile" directive, not "codebehind" as such, because I'm not precompiling. I'm just using a text editor to edit the aspx and codebehind files. Problem is, every time I make a change to the code or the aspx file, and refresh the page in the browser, it takes a 2 or 3 seconds to come up the first time, like it's doing an on-demand initial compile. I assume that's what it's doing, as after the initial load, the page refreshes without any delay at all.

This behaviour is quite frustrating when making small changes to the html or code. I'm coming from classic ASP, where you could edit-refresh-edit-refresh etc. all day without your "stride" being broken by waiting for a "compile", you know? So I'd love to know if there's a setting which prevents this initial delay. When I want to deploy, I can do a compile or something, but while making lots of small edits, I just need the page to run without that initial delay.

Posted: Jan 22, 2010 04:40 AM

View 6 Replies!   View Related
Show Data On Initial Page Load And Not Again
I would like to display my manager pic and name on initial page load and then the user has the ability to click on other dept. to view their manager. On page load i am doing a validation test to get the user name and display on the page, when the page first load i would like to run another query taking teamid and show the user manager pic and name initially and then they can click on other depts. How to do this sql query i know it can't be on page load since this would run over n over when the page loads even though the user wants to see other dept managers. Can someone assistant me on how to execute and show something on inital page load?

Posted: Jan 29, 2009 02:59 PM

View 4 Replies!   View Related
Radiobuttonlist And Load Page In Same Initial Position
I have this simple code in my page, I have a long page, if the client use this button then it shall reload the page and display the page from the beginning. I wish to be reload the page and display from the last position.

<asp:RadioButtonList ID="RadioButtonList5" runat="server" AutoPostBack="True"
RepeatDirection="Horizontal">
<asp:ListItem Value="45">Sheet2</asp:ListItem>
</asp:RadioButtonList>

Posted: Jun 17 10 at 4:39

View 1 Replies!   View Related
Set Dropdownlist Selected Value On Initial Page Load
I posted a similar question previously, but none of the answers worked and I've been scouring all over the web trying to find a solution. My situation, I have a Edit Window webform with a dropdownlist (Note: to avoid confusion, I'm using Telerik extensions only to decorate the webform):

<%@ Page Language="VB" CodeFile="EditFormVB.aspx.vb" Inherits="EditFormVB" %>
<%@ Register Namespace="CustomBoundField" TagPrefix="custom" %>
<!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>Edit Pop-up</title>
</head>
<body class="">
<form id="form1" runat="server">
<div>
<script type="text/javascript">
function CloseAndRebind(args) {
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit() {
GetRadWindow().close();
}
</script>
<asp:ScriptManager ID="ScriptManager2" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Vista" DecoratedControls="All" />
<br />
<br />
<asp:DetailsView ID="DetailsView1" DataKeyNames="ID" runat="server" AutoGenerateRows="False"
GridLines="None" DataSourceID="detailsSqlDataSource" Height="50px" Width="125px"
BorderWidth="0" CellPadding="0" CellSpacing="7">
<Fields>
<asp:BoundField DataField="TS_DESCRIPTION" HeaderText="TS_DESCRIPTION" SortExpression="TS_DESCRIPTION" />
<asp:BoundField DataField="TS_TITLE" HeaderText="TS_TITLE" SortExpression="TS_TITLE" />
<asp:CommandField ShowEditButton="True" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>--%>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Vista" />
<br />
<br />
<asp:DetailsView ID="DetailsView1" runat="server" Height="400px" Width="745px"
AutoGenerateRows="False" DataKeyNames="TS_ID" DataSourceID="SqlDataSource2"
EnableModelValidation="True">
<Fields>
<asp:TemplateField HeaderText="Category">
<EditItemTemplate>
<%--<asp:DropDownList ID="TTCategory" runat="server" DataSourceID="ReqCategoryData" SelectedValue='<%# Bind("TS_NAME") %>' />--%>
<asp:DropDownList DataSourceID="ReqCategoryData" DataTextField="ReqCategory" DataValueField="ReqCategory"
ID="reqCategoryDropDown" runat="server" AppendDataBoundItems="true" AutoPostBack="true" >
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ButtonType="Button" EditText="Update" ShowEditButton="True"
ShowCancelButton="True">
<ItemStyle HorizontalAlign="Center" />
</asp:CommandField>
</Fields>
</asp:DetailsView>
</div>
</form>
</body>
</html>

And in the code behind, I'm setting the datasource for the dropdownlist and using a function to query the DB for the name of the value I want to set as the selected value when the page loads initially: Partial Class EditFormVB Inherits System.Web.UI.Page

Public Shared category_Name As String = ""
Dim ddlDataSource As New SqlDataSource
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
DetailsView1.DefaultMode = DetailsViewMode.Edit
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Page.Title = "Editing record"
''Setup DropDownList SqlDataSource
ddlDataSource.ID = "ReqCategoryData"
Page.Controls.Add(ddlDataSource)
ddlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString
ddlDataSource.SelectCommand = "SELECT TS_NAME AS ReqCategory FROM dbo.TS_SELECTIONS WHERE (TS_FLDID = 5299 AND TS_STATUS = 0) ORDER BY TS_NAME"
Dim args As New DataSourceSelectArguments
ddlDataSource.Select(args)
''Set max length of Title field to 70 characters
Dim dvrTest As DetailsViewRowCollection = DetailsView1.Rows
Dim TitleTB As TextBox = dvrTest.Item(0).Cells(1).Controls(0)
TitleTB.Attributes.Add("onkeydown", "isMaxLen(this)")
TitleTB.Attributes.Add("maxlength", "70")
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
''Perform dropdown list population operations
If Page.IsPostBack = False Then
Dim ticket_ID As String = getDataKey(DetailsView1)
''Fetch Category ID
Dim sqlText As String = "SELECT TS_REQCATEGORY FROM USR_ITFAC WHERE (TS_ID = " + ticket_ID + ") "
Dim reqDataReader As SqlDataReader = GetDataReader(sqlText)
reqDataReader.Read()
Dim category_ID As String = reqDataReader(0)
''Fetch Category name using the categoryID and set as selected value in dropdown list
sqlText = "SELECT TS_NAME FROM TS_SELECTIONS WHERE (TS_ID = " + category_ID + ") "
reqDataReader = GetDataReader(sqlText)
reqDataReader.Read()
category_Name = reqDataReader(0)
myDDL.DataBind()
myDDL.Selectedvalue = category_Name //<--this value gets set only when debugging,
End If
End Sub
Private Function GetDataReader(ByVal sqlText As String) As SqlDataReader
Dim dr As SqlDataReader
Dim sqlConn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString)
sqlConn.Open()
Dim sqlCmd As SqlCommand = New SqlCommand(sqlText, sqlConn)
dr = sqlCmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
Return dr
End Function
End Class

The dropdownlist does get populated appropriately, however when I attempt to set the value, it doesn't reflect when the page loads; the dropdownlist just gets populated and no value is set to selected in the markup, so the first value is shown by default. The odd thing is that when I'm debugging, the value appears to get set when I step through the function, it's as if the selectedvalue is getting reset as soon as the function exits and proceeds to load the page.

SOLUTION: Had to add a separate function that is called onLoad from the DropDownList after the after Page_Load is done executing. Still unresolved is why the the DropDownList rebinds after the Page_Load.

IN HTML:
<asp:DropDownList DataSourceID="ReqCategoryData" DataTextField="ReqCategory" DataValueField="ReqCategory"
ID="reqCategoryDropDown" runat="server" AutoPostBack="true" OnLoad="DDL_DataBound">
IN CODE-BEHIND
Public Shared category_Name As String = ""
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Page.Title = "Editing record"
''Setup DropDownList SqlDataSource
ddlDataSource.ID = "ReqCategoryData"
Page.Controls.Add(ddlDataSource)
ddlDataSource.ConnectionString = ConfigurationManager.ConnectionStrings("TTPRODReportsQuery").ConnectionString
ddlDataSource.SelectCommand = "SELECT TS_NAME AS ReqCategory FROM dbo.TS_SELECTIONS WHERE (TS_FLDID = 5299 AND TS_STATUS = 0) ORDER BY TS_NAME"
Dim args As New DataSourceSelectArguments
ddlDataSource.Select(args)
''Set max length of Title field to 70 characters
Dim dvrTest As DetailsViewRowCollection = DetailsView1.Rows
Dim TitleTB As TextBox = dvrTest.Item(0).Cells(1).Controls(0)
TitleTB.Attributes.Add("onkeydown", "isMaxLen(this)")
TitleTB.Attributes.Add("maxlength", "70")
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
''Perform dropdown list population operations
If Page.IsPostBack = False Then
Dim ticket_ID As String = getDataKey(DetailsView1)
''Fetch Category ID
Dim sqlText As String = "SELECT TS_REQCATEGORY FROM USR_ITFAC WHERE (TS_ID = " + ticket_ID + ") "
Dim reqDataReader As SqlDataReader = GetDataReader(sqlText)
reqDataReader.Read()
Dim category_ID As String = reqDataReader(0)
''Fetch Category name using the categoryID and set as selected value in dropdown list
sqlText = "SELECT TS_NAME FROM TS_SELECTIONS WHERE (TS_ID = " + category_ID + ") "
reqDataReader = GetDataReader(sqlText)
reqDataReader.Read()
category_Name = reqDataReader(0)
myDDL.DataBind()
End If
End Sub
Protected Sub DDL_DataBound(ByVal sender As Object, ByVal e As System.EventArgs)
If Page.IsPostBack = False Then
Dim myDDL As DropDownList = DetailsView1.FindControl("reqCategoryDropDown")
myDDL.Items.FindByValue(category_Name).Selected = True
End If
End Sub

Posted: Jul 22 10 at 18:56

View 1 Replies!   View Related
How To Use JQuery To Create Controls In The DOM After The Initial Page Load
about how many are using jQuery to create controls in the DOM after the initial page load.Curious also about any conventions for naming DOM objects in relation to database objects.Seems you could almost render the entire page using jQuery..Does that mean I am only using ASP.Net for the fact that my page methods will run in IIS on the web server?

Posted: Feb 14th, 2011, 07:51 AM

View 17 Replies!   View Related
Mvc 2 Validation Always Shows Errors On Initial Page Load
I've searched around a lot, and honed this problem down to this case: I'm using the PRG pattern, pragmatically I'm using the same DTO for my post/get actions. It looks like when I have the dto with the data annotation attributes in the get action parameter list, the validation is always displaying errors, every time on initial page load. In some cases this could be desired behavior if you put asterisks in the error message, but how do I get rid of it?

Posted: May 14 10 at 14:57

View 1 Replies!   View Related
AJAX :: How To Use Updatepanel With Gridview To Hide It On Initial Page Load
I have a gridview whose data is populated from an object datasource. Now since this data loading happens on initial page load , i want to render the other two controls (Text box and a Button) on the page and show "Loading" text or image in place of the gridview till all the data is retrieved. I read around the forums and saw that to make this work I need to use UpdatePanel, ScriptManager and UpdateProgress controls.

I have embedded the gridview in the ContentTemplate Tags of update panel . I also associated the ID of the panel to the update progress control. Now only thing i'm left with is how to make the initial page load trigger the gridview after the whole data is retrieved.

here is the code i got so far

[Code]....

Posted: Nov 03, 2009 10:10 PM

View 3 Replies!   View Related
MVC :: Html.ValidationSummary Appears On Initial Load Of Page And It's Empty
I am not sure what I am doing wrong in how I set up validation on my models and viewmodels. For some reason on several of my views that contain a validation summary, it appears empty on initial load of the page. On some other pages it appears correctly when the form's data is posted and it does not appear on initial load, this is the way that I would expect it to work.

On the views where this is occuring, my viewmodels are somewhat more complex in that they contain another complex type that I am passing around that has it's own set of DataAnnotation Validation properties, but I have called the validation summary like this; Html.ValidationSummary(true) so that those properties are not validated.

Posted: Jul 23, 2010 10:40 PM

View 5 Replies!   View Related
Configuration :: Slow Initial Page Load Speed And Compile Settings
Over the last week I've been investigating an issue for one of our clients whereby the initial page load following a deployment of their website takes around 1 minute, resulting in unacceptable downtime for end users. This was happening not only for code deplyments (bin dll's and .config files) but also if there were large numbers of .aspx pages updated. For code deployments it's not an issue, but for aspx updates it is; in this particular scenario, we are making use of a 3rd party content management system (RedDot from OpenText) in which every page of the site is published out as a distinct .aspx page. This means that for this website there's somewhere in the region of 2,400 separate .aspx pages. I realise this isn't an ideal situation but we're working within the constraints of the CMS, and we managed to correlate the instances where the site was unresponsive with App pool restarts, which also corresponded to publications of of .aspx pages.

I found an article by Tess Ferandez [URL] which describes all the reasons why the app pool may restart, and it does seem that if more than 15 .aspx pages are changed then the app pool will recycle and the pages will be re-compiled. Another msdn article [URL] then gave me a few pointers on how to start addressing this problem, and for the moment I've set a flag on the compilation options to prevent batch compilation:

<compilation batch="false">

This means that the initial page load now takes around 6 seconds instead of 1 minute, which is a great improvement. However, I also used the "Compilations Total" performance counter to investigate the number of pages that have been compiled by ASP.NET for my site and was quite surprised that the total number of pages that get compiled peaks at 44, which is odd given that there are 2,400 aspx pages in the site. If the batch flag is set to false, the counter slowly increments by 1 page at a time as you click around on the site; if batch mode is true, the initial compilation takes the number straight to 44 over the course of ~60 seconds. What I'm really struggling to understand is why all 2,400 pages aren't compiled. Does anyone have any inside info on what might be going on as all the documentation I've read seems to indicate that all of the pages should be compiled and this counter should be much higher.

Posted: Dec 08, 2010 01:23 PM

View 1 Replies!   View Related
Web Forms :: How To Start / Suspend / Resume Thread
check this code about threading ..

i am getting different o/p every time. just i want to start the thread ,suspend that thread and resume that thread .

namespace ThreadTest
{
class Program
{
static void Main(string[] args)
{
Thread th = new Thread(new ThreadStart(new Program().Call));
th.Start();
Console.WriteLine("STARTED");
th.Suspend();
Console.WriteLine("SUSPENDED");
th.Resume();
Console.WriteLine("RESUMED");
Console.ReadLine();
}
public void Call()
{
for (int i = 1; i < 200; i++)
{
Console.WriteLine(i.ToString());
}
}
}

Posted: Jul 16, 2010 12:54 PM

View 5 Replies!   View Related
Web Forms :: Start Two Asynchronous Database Access Calls That Are Executed Onto The Separate Thread?
i have the code for asynchronous call to the database. i execute the sql command into the begin method that will executed onto the separate thread. now i want to execute the another database call asynchronously so that this also execute onto the separate thread. code for one database cal is here....

private SqlConnection con, con1;
private SqlCommand cmd, cmd1;
private SqlDataReader dr, dr1;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
AddOnPreRenderCompleteAsync(new BeginEventHandler(Begin),
new EndEventHandler(End)
);
}
}
/////////////BEGIN METHOD
IAsyncResult Begin(object sender, EventArgs e,AsyncCallback cb, object state)
{
string connect = "Data Source=.\SQLEXPRESS;Asynchronous Processing=true;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True";
con = new SqlConnection(connect);
con.Open();
cmd = new SqlCommand("SELECT FirstName,LastName,Age,Company,Profile FROM Person",con);
return cmd.BeginExecuteReader(cb, state);
}
//////END METHOD
void End(IAsyncResult ar)
{
dr = cmd.EndExecuteReader(ar);
Label2.Text = System.Threading.Thread.CurrentThread.GetHashCode().ToString();
GridView1.DataSource = dr;
GridView1.DataBind();
}

Posted: Sep 02, 2010 08:57 AM

View 1 Replies!   View Related
Web Forms :: Idle Initial Load Times?
when loading anASP.NET webpagethat's been idle for, say, 20-30 minutes, why the initial load takes 5-6 seconds and all subsequent loads take under a second? Since, in many situations, I'm loading less than 100 records from a table in SQL Server over to the page, 5-6 seconds seems a tad excessive. Is there anything I can do to make that initial load time as speedy as thesubsequent load times?

Posted: Aug 26, 2009 08:26 PM

View 1 Replies!   View Related
Loading Hierarchy Of Main Thread And Background Thread When IE7 Loads Page
Does anyone out there understand the loading hierarchy of the main thread and the background thread when IE7 loads a page?

The reason I ask is because an animated gif that we have will not render it's animation in IE7. With Firefox & Safari there is no problem.

We can do a conditional statement with - window.addEvent('domready', function() - and then put the code inside that function and it runs ok.

This is not the first time that I have had problems with animated gifs loading in IE7. What's the deal IE?

Posted: Apr 30, 2009, 08:25

View 1 Replies!   View Related
Web Forms :: Hide Divs On The Initial Load And Make Them Appear On A Postback Event?
I have several divs on an asp page. All of my divs are runat="server". On the initial load of my page I set all the divs visible property to false because I dont want them to appear on the first show. Then, I have a drop down list raising postback events.

On the selected index changed event I am setting the visible property of my divs to true to make them appear on the page. However this does not work.

I discovered that, on the initial load non of my divs are added to the page's html content. So, on a postback event non existing divs can not be made to appear. If all the divs would set to visible = true on the initial load, postback event would work just expected.

Could any one tell me a way to hide divs on the initial load and make them appear on a postback event?

Posted: Dec 01, 2010 12:49 PM

View 3 Replies!   View Related
How To Start A New Thread To Query A Database While Web Application Continues Running
I want to start a new thread to query a database while my web application continues running. I was under the impression that by using threads I can run the querying process independently while the normal web application page cycle carries on, but I could be wrong.

public class DbAsyncQuery
{
Dictionary<string, object> serviceResults = new Dictionary<string, object>();
public void UpdateBillingDB()
{
QueryAllServices();
foreach (KeyValuePair<string, object> p in serviceResults)
{
IEnumerable results = (IEnumerable)p.Value;
IEnumerable<object> sessions = results.Cast<object>();
DbUtil.MakeBillingDBEntry(sessions, p.Key);
}
}
public static string[] servicesToQuery = new string[] // Must go in config file ultimately
{
"xxx.x.xxx.xx"
};
public delegate void Worker();
private Thread worker;
public void InitializeThread(Worker wrk)
{
worker = new Thread(new ThreadStart(wrk));
worker.Start();
}
public void InitializeQuery()
{
Worker worker = QueryAllServices;
InitializeThread(worker);
}
private void QueryAllServices()
{
Dictionary<string, DateTime> lastEntries = DbUtil.GetLastEntries();
foreach (string ip in servicesToQuery)
{
string fullServicePath =
"http://" + ip + ":800/MyWebService.asmx";
//object[] lastEntry = new object[] { lastEntries[ip] };
object[] lastEntry = new object[] { new DateTime(2011, 1, 1, 0, 0, 0) };
object obj = WebServiceHandler.CallWebService
(fullServicePath, "MyWebService", "GetBillingDBEntries", lastEntry);
serviceResults.Add(ip, obj);
}
}
}

It seems to basically stall and wait to finish the query before loading the page (which can be thousands of rows, so it takes awhile). I put this in the following section of Global.asax:

protected void Application_Start(object sender, EventArgs e)
{
DbAsyncQuery query = new DbAsyncQuery();
query.UpdateBillingDB();
}

This is one of my first web pages, and I'm new to threading. I understand there is a difference between creating your own thread and using the ThreadPool. In this method, I am using my own thread, I think. Not sure if that's the best way. The querying process can be completely independent, and its only going to occur on scheduled intervals (every 8 hours or so). The user doesn't need to have up to the minute data, so it can take awhile. I just don't want the site to wait for it to finish, if that's possible.

Posted: Feb 11 at 4:08

View 1 Replies!   View Related
C# - App_Themes Not Loading On Initial Load
I have an application where different users can log in via a single portal login. When they log
in, if they belong to more than 1 company they have to select the company they belong to. The theme will change if there is a custom theme for that company. Each page my application has inherits a "CustomPage" class. Here is the code for the custom page:

public class CustomPage : Page
{
protected void Page_PreInit(object sender, EventArgs e)
{
if (Globals.Company != null && Directory.Exists(Page.MapPath("~/App_Themes/" + Globals.Company.CompanyName)))
{
Page.Theme = Globals.Company.CompanyName;
}
else
{
Page.Theme = "Default";
}
}
}

When the customer belongs to more than 1 company, and they select the company they belong to, the theme loads just fine. So, the problem I am having is this: If they belong to just 1 company, the company is automatically selected but the theme does not load right away. However, if I refresh the page, the theme loads just fine. Even the default theme will not load. The page has no css at all until I refresh.

I even view source and look for my css names and they are not there. I refresh and do the same thing, and they are there. I am not using forms authentication and the default theme in the web config is "Default"

<pages theme="Default">

Posted: Jun 14 10 at 18:31

View 1 Replies!   View Related
Cross-thread Operation Not Valid: Accessed From A Thread Other Than The Thread It Was Created On
I want to remove checked items from checklistbox (winform control) in class file method which i am calling asynchronously using deletegate. but it showing me this error message:-

Cross-thread operation not valid: Control 'checkedListBox1' accessed from a thread other than the thread it was created on.

i have tried invoke required but again got the same error. Sample code is below:

[code]....

Posted: Apr 2 10 at 8:09

View 1 Replies!   View Related
AJAX :: AsyncFileUpload - Must Exist On Initial Load?
I've stumbled across a strange problem with the AsyncFileUpload control: if the control doesn't exist on the initial load, the UploadedComplete event does not fire. For example, the following code works just fine:

[Code]....

But as soon as the code is wrapped in an if (IsPostBack) condition as shown below, FileUploaded no longer fires, even though the code is otherwise identical:

[Code]....

Would anyone be able to shed some light on why this is happening?

Posted: Oct 05, 2010 06:09 PM

View 3 Replies!   View Related
MVC Switching Cultures After Compile For Initial Load
I have a hybrid ASP.Net web forms/MVC app. On one of the MVC "pages"/views, I have it render a bunch of dates using the ToShortDateString() and ToLongDateString(). These work correctly most of the time, but the first time I load the view after compiling the app, they are formatted incorrectly.

I traced this down and checked the current thread's culture. For 99% of the time it's en-US, but on the first load of the MVC view after compiling it is set to en-GB. If I reload the page immediately after that, it's back to en-US.

I have tried setting the culture and uiculture in the web.config file to en-US to force it to be correct, but no luck.

Posted: Nov 3 10 at 20:55

View 1 Replies!   View Related
Configuration :: Initial Web Application Load Is So Slow?
I have a simple web application that loads very slow the very first time after i deploy it.I am using ASP.NET 3.5 SP1 / VS 2008 / Linq / Web forms to load the default.aspx home page. It is a very light page with nothing too fancy.Now to debug this load issue, I logged all the events in the global file and got the following log text:

2010-04-10 11:58:38,083 - Application_Start
2010-04-10 11:58:38,111 - Application_BeginRequest
2010-04-10 11:58:38,117 - Application_AuthenticateRequest
2010-04-10 11:58:52,321 - Session_Start
2010-04-10 11:58:52,454 - Page_Load
2010-04-10 11:58:53,951 - End Page_load
2010-04-10 11:58:53,981 - Application_EndRequest

Now my question is, between the Application_AuthenticateRequest and Session_Start functions, there is generally around 10 - 15 seconds - which i believe seems to be the problem.The thing, I am unsure why this is slow between these two functions.I am not using any forms authentication.Also, I am not doing anything fancy in the global file besides setting a session variable.

Posted: Apr 11, 2010 01:05 AM

View 9 Replies!   View Related
RadComboBox EmptyMessage Not Showing On Initial Load?
For some reason my RadComboBox "EmptyMessage" is not showing on the initial load of the page but it does after I focus and blur out of the control. How can I force my "EmptyMessage" to show by default?

My .aspx is as follows:

<telerik:RadComboBox
ID="SomeFilter" runat="server"
EmptyMessage="Choose..."
OnClientSelectedIndexChanging="OnClientSelectedIndexChanging"

[Code].....

My combobox defaults to "Test1" by default instead of "Choose...". Once I open and close the combobox, however, the default changes to "Choose...".

Posted: Jan 11 at 18:55

View 1 Replies!   View Related
SQL Reporting :: Reportviewer Parameters Not Being Accepted On Initial Load
I have an ASP.NET web site using a reportviewer control in local mode. The reportviewer is hidden on page load because I want the user to make dropdown list selections first and then click a "Run Report" button to view the report. The problem is the first
time the "Run Report" button is clicked, it does not accept the dropdown selections.

For example, if I load the .aspx page, select a StartYear of 2005 from the first dropwdown and EndYear of 2009 from the second dropdown, and click "Run Report". The report displays, but instead of using my dropdown selections, it uses the dropdown default values. Also, the dropdown selections I made are not preserved (they go back to the default values).

However, if I then make new selections and click "Run Report" again, the report displays correctly and my dropdown selections are preserved as I hoped they would be the first time I ran the report. Has anyone run into this problem before? It appears everything is working correctly, it's just that initial load that is causing the problem.

Posted: Dec 21, 2009 01:51 AM

View 8 Replies!   View Related
Adding Javascript On Initial Load After Updating UpdatePanels?
On my Page_Load command for a page, I have a couple of tests that are performed before the screen is displayed with an alert box displaying if the user cannot access the screen. If Not Page.IsPostBack Then

UpdatePanel1.ContentTemplateContainer.Controls.Add(ctl)
UpdatePanel1.Update
UpdatePanel2.ContentTemplateContainer.Controls.Add(ctl)

[code]...

Posted: Mar 24 at 1:10

View 1 Replies!   View Related
Setting Focus On Text Field On Initial Load Of Form
I want the cursor to appear on the first text box in my screen when user goes to the site I have coded this but no cursor is placed in textbox

<form id="Form1" defaultfocus="TextboxTelephone" method="post" runat="server">

I have to tab to get cursor in first textbox telephone.

Posted: Apr 15, 2010 03:34 PM

View 3 Replies!   View Related
Slow Initial Load - Sending A HTTP Request To Website?
I'm well aware that in a shared hosting environment, the AppPool gets recycled (default is 30 mins I think?) and sites that don't get many visitors gets unloaded or something. So, How can I write a request, such that I can set it to "ping" my website once every 15 mins or so - what's the code to it?

Is this a common problem among unpopular sites that doesn't get that many hits in a day? And is the only way to solve it to "ping" the site to keep it alive?

Posted: Dec 23, 2008 03:31 PM

View 4 Replies!   View Related
C# - Referenced Assembly Won't Load In New Thread On IIS 7
I have a process in which a user uploads a file to a web site where the file is then processed and uploaded into the database. The process of validating the file could take several minutes so as soon as the file is uploaded I create a new thread and I do my processing on this second thread. This works great on my local machine but doesn't work at all on my IIS 7 test server.

After some investigating I found the problem is that the process is trying to load a reference to Castle and it can't find the DLL. I have a copy of Castle DLLs in my bin and it works elsewhere in my app. I ran Fuslog and discovered that it is trying to load castle from the wrong location. It is trying to load from c:/windows/system32/inetsrv/.

It appears that under IIS 7 the second thread is executing in a different context or something.

Posted: May 25 10 at 19:44

View 1 Replies!   View Related
C# - Load Data To Application Domain Using A Thread?
I want to load data to my application domain using a thread so it will be executed at all times. How can I achieve this? I want the thread will start when iis starts and terminate when iis exits.

Note:

I want to do this so I can use disconnected architecture in my asp.net application.

Posted: Jan 22 at 8:52

View 1 Replies!   View Related
Databases :: Thread: Unable To Load DLL 'OraOps10w.dll': Access Is Denied?
Below is our error message. This happens around 5 - 7AM daily, and we are struggling with identifying the root cause. It's hard for me to believe it's code related, but anything's possible. Still, what's odd is the app runs fine for a day then an IIS reset is done and everything is fixed. Is there any way this could be related to code and has anyone dealt with this error before? Could a job or some permission being run behind the scenes be using this same dll and cause it to be overwritten?

Timestamp: 3/4/2010 12:11:23 PM
Message: HandlingInstanceID: 3d9a795c-1256-44c1-b018-f553d4023b12
An exception of type 'System.TypeInitializationException' occurred and was caught.

[code]...

Posted: Mar 08, 2010 06:10 PM

View 2 Replies!   View Related
Web Forms :: Use Thread.sleep Method For A Particular Thread?
I want a example of multithreading .i want to use it in a web form not on console.i am using C#.net .and how to use thread.sleep method for a particular thread.

Posted: Aug 27, 2010 01:14 PM

View 5 Replies!   View Related
Web Forms :: Adding An IFrame In Code Behind Not Showing The Subpage Or Anything Just The Initial Page ?
iam trying to add an iFrame to an code behind file dynamically, using cell.Controls.Add(new LiteralControl("<iframe id=AttachmentFrame scrolling='yes' frameborder='1' title='ShowAtt' width='100%' height='50%' src='pdf/1.pdf'></iframe>"));

row.Controls.Add(cell);
viewTable.Rows.Add(row);

when launching the page its loading the pdf then not displaying in the webpage even when i try to open another aspx page in the iframe nothing is appearing although seems launching the webpage cuz it asks me username and password then nothing displays.while adding the iframe in the aspx file its both links are working correctly

note: i have a friend told me that in code behind like the one above have he has it working correctly but in my case i dont know whats wrong!

Posted: Mar 09, 2011 01:00 PM

View 1 Replies!   View Related
Start Batch Job From IIS / Start Exe File With System.Diagnostics.Process.Start With Another Account Is Disabled?
What is the right approach when users (authenticated domain admins) should be able to start batch jobs (usually exe files) from an IIS (7.x) aspx (c#) page? This is an intranet site. The batch jobs have to run on the web server as Domain Admins. The website pool is executed by network service or some similar restricted account in AD.

Approaches I can think of (and their disadvantages):
1. Start exe file with System.Diagnostics.Process.Start with another account. This feature is disabled in IIS 7.x, how do I allow it?

2. Create a sheduled task and call scheduled task-api. This unmanaged dll is giving VS compiler warnings because it's unsafe to call from managed code.

3. I suppose there's a better approach, because the previous suggestions doesn't appear safe or robust.

Posted: Oct 28 10 at 11:54

View 2 Replies!   View Related
AJAX :: ToolBox Does Not Load At VS Start Up?
I went to the Code Plex site and down load the latest toolkit. Then followed the instructions on how to set up the toolkit to the letter. When I first loaded the toolkit everything worked. But now every time I start up my computer and start VS all the AJAX controls I have on any page has the green squiggly line underneath it and the error says:Element <AJAX Control Name> is not a known element. This can occur if there is a compilation error in the web site, or the webconfig file is missing.The only thing I can do is delete the Ajax Toolkit tab then add the tab again and then "Choose Items..." and load the Ajax controls again. Then I have to add an AJAX control from the toolkit to any webpage. Once that is done all the green squiggly lines go away and I can continue.This is becoming an incredible pain. Please let me know what I can do to fix this.

Posted: Oct 25, 2010 08:02 PM

View 3 Replies!   View Related
Web Forms :: DropDownList - Page Loads Initial Value Should Blank Until Clicking The Dropdown Button
i have dropdownList Binded to a data source and its working fine But want i want to do is when the page loads its initial value should Blank until clicking the dropdown button

Posted: Jul 10, 2010 07:09 AM

View 6 Replies!   View Related
Web Forms :: How To Load From Secondary (Derived) Master Page Controls In Page Load
I hv Declared two Master page one Is Base and Derived.. Base Page Load is working but when i hv written load controls in Derived Page Load Using C# it's not working..

Posted: Feb 25, 2010 09:58 AM

View 3 Replies!   View Related
Page Event After Displaying Initial Page State?
I want to make a page that tells the client to wait, while behind the scenes an email is sent, this takes like 5-10 secs. Obviously this doesnt work by putting the code to send email in the page load becuase it does this before it displays the page. I cant seem to find an event that occurs AFTER the page is loaded. What i would like to do is load the page, telling the user to wait while email is sent, then send the email and after it is done sending, shows a label to inform the user that they are done and they can close the webpage.

Posted: Apr 03, 2009 05:44 PM

View 1 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved