Showing posts with label working. Show all posts
Showing posts with label working. Show all posts

Saturday, March 31, 2012

Themes not working sometimes.

I am setting the src of a Iframe in the page load like this:
fraContent.Attributes.Item("src") = "Splash.aspx"
and sometimes the themes do not work. The page displays in the browser but
the themes are not applied. The <link ... is on the page when I look at the
soruce.
Any Ideas.
Thank you,
--
JerryHello Jerry,
I do not have your source code to test on directly. But here are some
suggestions that, I think, deserve your trial.
1. Does the "<link _" links to the correct theme page when the themes are
not applied? Please pay attention to the relative path. In my best guess,
the theme page cannot be loaded because the relative path to the page is
not correct.
2. Is the line fraContent.Attributes.Item("src") = "Splash.aspx" inside the
if statement: if (!Page.IsPostBack) { _ }?
If that, when the page post-back occurs, the line
fraContent.Attributes.Item("src") = "Splash.aspx" will not be executed in
the Page_Load event handler.
We can debug the site in Visual Studio, set a breakpoint on
fraContent.Attributes.Item("src") = "Splash.aspx" and see if it is executed
every time when we need to load the theme page.
3. When the theme page cannot be loaded, what is the browser? As far as I
know, some browsers do not support html tags very well.
By the way, since ASP.NET 2.0, a new feature "Theme & Skin" has been
supported by ASP.NET. If your theme pages only contain style information,
I'd suggest using ASP.NET Theme, which is much easier to accomplish the
task. For more information about "Theme and Skin" in ASP.NET, please refer
to:
ASP.NET Themes and Skins Overview
http://msdn2.microsoft.com/en-us/library/ykzx33wh.aspx
How to: Apply ASP.NET Themes Programmatically
http://www.15seconds.com/issue/040105.htm
Code in Style with ASP.NET Themes.
http://www.15seconds.com/issue/040105.htm
Hope it helps.
Regards,
Jialiang Ge (jialge@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
==========
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...t/default.aspx.
========================================
==========
This posting is provided "AS IS" with no warranties, and confers no rights.
Hello Jerry,
Sorry for the incorrect link to the article "How to: Apply ASP.NET Themes
Programmatically".
The link should be:
http://msdn2.microsoft.com/en-us/library/tx35bd89.aspx
If you have any other concerns or need anything else, please feel free to
let me know.
Regards,
Jialiang Ge (jialge@.online.microsoft.com, remove 'online.')
Microsoft Online Community Support
========================================
=========
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
========================================
=========
This posting is provided "AS IS" with no warranties, and confers no rights.
Jialiang,
Thank you for your reply. The problem only occurs SOME of the time so all
the links are about appying the themes and if the code was not correct the
themes would not be there ALL of the time not just SOME of the times.
Anyway.
I have fixed the problem. This does not explain why the problem occured in
the first place. I placed a system.threading.thread.sleep line in the
LoadComplete event of the page. this seemed like the same problem solved by
the waitForEvents in window forms.
Have you seen any of this kind of problem.
Thank you
--
Jerry
"Jialiang Ge [MSFT]" wrote:

> Hello Jerry,
> Sorry for the incorrect link to the article "How to: Apply ASP.NET Themes
> Programmatically".
> The link should be:
> http://msdn2.microsoft.com/en-us/library/tx35bd89.aspx
> If you have any other concerns or need anything else, please feel free to
> let me know.
> Regards,
> Jialiang Ge (jialge@.online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> ========================================
=========
> When responding to posts, please "Reply to Group" via your newsreader
> so that others may learn and benefit from your issue.
> ========================================
=========
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>

Wednesday, March 28, 2012

Thinks to be followed while working in asp.net in V2005

I am very new to V2005 .and now i have stared a new project in that anybody
who have experianced plz give me some suggestion /rules to be followed while
doing a asp.net project in V2005

Regards
PrabakarThat's a very broad question :)

There isn't anything in particular that I would suggest...except...

If you come from a classic ASP or PHP background, open your mind to doing
things differently.

I've seen many people who are new to ASP.Net and just don't get it. For
example, instead of using DataBound controls, I've seen people use for loops
and output HTML like they normally would.

ASP.NET is very different and has a big learning curve. Start small and
learn as you go...don't get discouraged :)

Karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
"Prabakar Samiyappan" <PrabakarSamiyappan@.discussions.microsoft.comwrote
in message news:96785518-D0A9-4294-BC72-2061F8B194EA@.microsoft.com...

Quote:

Originally Posted by

>I am very new to V2005 .and now i have stared a new project in that anybody
who have experianced plz give me some suggestion /rules to be followed
while
doing a asp.net project in V2005
>
Regards
Prabakar

Thinks to be followed while working in asp.net in V2005

I am very new to V2005 .and now i have stared a new project in that anybody
who have experianced plz give me some suggestion /rules to be followed while
doing a asp.net project in V2005
Regards
PrabakarThat's a very broad question :)
There isn't anything in particular that I would suggest...except...
If you come from a classic ASP or PHP background, open your mind to doing
things differently.
I've seen many people who are new to ASP.Net and just don't get it. For
example, instead of using DataBound controls, I've seen people use for loops
and output HTML like they normally would.
ASP.NET is very different and has a big learning curve. Start small and
learn as you go...don't get discouraged :)
Karl
http://www.openmymind.net/
http://www.fuelindustries.com/
"Prabakar Samiyappan" <PrabakarSamiyappan@.discussions.microsoft.com> wrote
in message news:96785518-D0A9-4294-BC72-2061F8B194EA@.microsoft.com...
>I am very new to V2005 .and now i have stared a new project in that anybody
> who have experianced plz give me some suggestion /rules to be followed
> while
> doing a asp.net project in V2005
> Regards
> Prabakar

This connections gonna kill me

This is a long one. (Question that is) an I have been working on this problem for a week now and still have no idea. There are no systems/database people here to help.

I have used the following string to succesfully connect to my SQL Server
database :

"Provider=SQLOLEDB.1;
Password=mypassword;
Persist Security Info=True;
User ID=VSdotNET;
Initial Catalog=ITPSCustomers;
Data Source=DELL\VSdotNET"

The problem is that I do not want SQL Server authentication so I opened up
SQL Server, removed the login VBdotNET, added it again and changed the user
authentication to Windows. I then changed the connection string to :

"Provider=SQLOLEDB.1;
Integrated Security=SSPI;
Persist Security Info=False;
Initial Catalog=ITPSCustomers;
Data Source=DELL\VSdotNET"

DELL\VSdotNET is a Login and has been given permission to access the
database ITPSCustomers.

Within the Database node for ITPSCustomers database DELL\VSdotNET has been
added as a user and has been given all permisions to the tables and views
within the database.

When I now run my web page I get the errors :

System.Data.OleDb.OleDbException: Cannot open database requested in login
'ITPSCustomers'. Login fails.
at System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr)
at System.Data.OleDb.OleDbConnection.InitializeProvider()
at System.Data.OleDb.OleDbConnection.Open()
at DreamweaverCtrls.DataSet.DoInit() System.Exception:
The DefaultView was requested but no tables yet exist.
at DreamweaverCtrls.DataSet.get_DefaultView()

Can anyone help ?two things:

You should be using the SqlClient Namespace for all things related to data since you're using SQL Server (it's much faster)
Try this connection when using a SqlConnection

"Data Source=DELL\VSdotNET;
Trusted_Connection=True;
Initial Catalog=ITPSCustomers"

Hope that helps :)
Well the question is when you switched to windows authentication did you add the user unders security=>users in enterprise manager. Under the general tab beside name you get a browse button to pick a windows login to add and then you specify what database it can access under the database access tab. The SqlClient namespace is better for sql server (or msde) but it is unlikely to be the cause of the problem.

Monday, March 26, 2012

This is a real getting started question

Brand new at the dynamic pages. I have been working through the Web Matrix ASP.NET tutorial @dotnet.itags.org. http://www.asp.net/webmatrix/guidedtour/getstarted/intro.aspx and I had some trouble connecting to the IIS Server they told me to name MatrixTour. At any rate, I created a login page, and it ran fine through the Web Matrix built in server, however, when I save it in my root directory and attempt to access it via the Web, I get a 404 Error. Page not Found. I have verified that the page is in the root directory, so I'm a bit stuck. I assume this is something simple (and stupid) on my part, but, I could use some help.errr... what OS are you running it on? if this is a windows 2003 server which has certain extensions disabled, you'd get a 404
It is a Windows 2003 server. I am running the Ensim control panel. I have it set to Scripts only. When I remote desktop to the server, and go into IIS Manager, I have the following configuration under Web Extensions:

All Unknown ISAPI Extensions - Prohibited
All Unknown CGI Extensions - Prohibited
Active Server Pages - Allowed
ASP.NET v1.1.4322 - Allowed
Frontpage Server Extensions 2002 - Allowed
Indexing Service - Allowed
Internet Data Connector - Allowed
PERLCGI - Allowed
PERLISAPI - Allowed
PHPCGI - Allowed
Server Side Includes - Allowed
WebDAV - Prohibited

In addition to being new to ASP.NET and ASP pages generally, I recently got this dedicated server, so I am learning about the set-up while I am moving all of the sites I manage over to it. I've bitten off a little bit, I know, but, hey, no better way to learn, than under the gun, right? It forces me to pay attention and learn. I have been wanting to learn more about dynamic pages and database driven sites, and now I am. That said, I'll probably ask a ton of really stupid questions here. Not that I want anyone to build my code for me, just head me in the right direction so I can learn how to do it myself...

Thanks for any help you can give!

Dan
woo. youare jumping in feet first, aren't you? OK. so we've eliminated the extensions issue.

err... doubt you need the IDC or Indexing enabled, btw.

so this is an ASPX file you're atempting to run?
Yes, it is. http://www.pittsburghpipeband.com/800html/MemberLogin.aspx

Incidentally, I found another post on a board that had the same problem. Here's the URL:

http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=424900

I decided to try the suggestion by AccuBubba in the 3rd reply and after running the command, it fixed the 404 error. I assume that there was a config issue either in the order IIS and ASP.NET and the .NET framework was installed, or more likely that the ASP.NET install was corrupt or unfinished. Now, I am getting a runtime error.

I am about to go back over to the server to make certain that I didn't delete that page accidentally, although, I would think that would bring up another 404 error. I assume it is a security issue, but am unsure of everything I need to check.

By the way, I love what I've seen of your site. I was a little intimidated about what your reply might be after having read the RTFM and the "Should you really be trying this?" but, I am going to learn! Just not going to ask how to make a Hotmail Clone... :)
HMMMMMMMMMMMMMMM, Atrax, maybe I shouldn't be doing this after all.

I have been going over this and over this, and looking at the error page I got as well as the steps I took making this page, it seems I forgot to make my web config file. I'm betting this fixes it.

Not sure if I'm stupid or just hurrying too much. I'll post and let you know though.
OK, I know I'm pretty much talking to myself here. I have to assume that this is a config issue with IIS because I have made several changes to the web.config file (starting with building one in the first place, which I forgot to do.) I got rid of the 404 error. Now, I am getting another error:

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off". I did this. So, when I remote Desktop to the server, and run the page in IE, it says this:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Server cannot access application directory 'c:\Program Files\Ensim\Site Data\pipes\Inetpub\wwwroot\'. The directory does not exist or is not accessible because of security settings.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Server cannot access application directory 'c:\Program Files\Ensim\Site Data\pipes\Inetpub\wwwroot\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263

[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +964
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128

So, that leads me to believe that permissions or security issues are involved. Am I on the right path? Anything I should try? I have to assume that this being the major issue at this point, and not being the ultimate configuration person, I can handle the rest of it...once I get it to run in the browser.

Saturday, March 24, 2012

this.Dropdownlist not working

I added a textbox to a c# page and can access it with code behind but added
a
dropdown list by draging it on the page from the toolbar but when typing
this. the dropdown id is not selectable and I can not access any of its
attributes.
--
Paul G
Software engineer.assuming this is 1.x, you'll need to go in our codebehind, expand the
desiner region and add
protected DropDownList controlId;
like
protected DropDownList States;
you should see other similar controls there..
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:BEC317EE-DAEB-4BA7-908A-4036BB9F5CB6@.microsoft.com...
>I added a textbox to a c# page and can access it with code behind but added
>a
> dropdown list by draging it on the page from the toolbar but when typing
> this. the dropdown id is not selectable and I can not access any of its
> attributes.
> --
> Paul G
> Software engineer.
working now, not sure what happened.
--
Paul G
Software engineer.
"Paul" wrote:

> I added a textbox to a c# page and can access it with code behind but adde
d a
> dropdown list by draging it on the page from the toolbar but when typing
> this. the dropdown id is not selectable and I can not access any of its
> attributes.
> --
> Paul G
> Software engineer.
ok thanks for the reply. I thought all of that code was generated
automatically when you put the control on the form.
--
Paul G
Software engineer.
"Karl Seguin [MVP]" wrote:

> assuming this is 1.x, you'll need to go in our codebehind, expand the
> desiner region and add
> protected DropDownList controlId;
> like
> protected DropDownList States;
> you should see other similar controls there..
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:BEC317EE-DAEB-4BA7-908A-4036BB9F5CB6@.microsoft.com...
>
>
Most of the time ;)
Karl
http://www.openmymind.net/
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:C3219EE8-856F-4861-8CDA-9E35C46F671E@.microsoft.com...
> ok thanks for the reply. I thought all of that code was generated
> automatically when you put the control on the form.
> --
> Paul G
> Software engineer.
>
> "Karl Seguin [MVP]" wrote:
>

this.Dropdownlist not working

I added a textbox to a c# page and can access it with code behind but added a
dropdown list by draging it on the page from the toolbar but when typing
this. the dropdown id is not selectable and I can not access any of its
attributes.
--
Paul G
Software engineer.assuming this is 1.x, you'll need to go in our codebehind, expand the
desiner region and add

protected DropDownList controlId;

like

protected DropDownList States;

you should see other similar controls there..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:BEC317EE-DAEB-4BA7-908A-4036BB9F5CB6@.microsoft.com...
>I added a textbox to a c# page and can access it with code behind but added
>a
> dropdown list by draging it on the page from the toolbar but when typing
> this. the dropdown id is not selectable and I can not access any of its
> attributes.
> --
> Paul G
> Software engineer.
working now, not sure what happened.
--
Paul G
Software engineer.

"Paul" wrote:

> I added a textbox to a c# page and can access it with code behind but added a
> dropdown list by draging it on the page from the toolbar but when typing
> this. the dropdown id is not selectable and I can not access any of its
> attributes.
> --
> Paul G
> Software engineer.
ok thanks for the reply. I thought all of that code was generated
automatically when you put the control on the form.
--
Paul G
Software engineer.

"Karl Seguin [MVP]" wrote:

> assuming this is 1.x, you'll need to go in our codebehind, expand the
> desiner region and add
> protected DropDownList controlId;
> like
> protected DropDownList States;
> you should see other similar controls there..
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:BEC317EE-DAEB-4BA7-908A-4036BB9F5CB6@.microsoft.com...
> >I added a textbox to a c# page and can access it with code behind but added
> >a
> > dropdown list by draging it on the page from the toolbar but when typing
> > this. the dropdown id is not selectable and I can not access any of its
> > attributes.
> > --
> > Paul G
> > Software engineer.
>
Most of the time ;)

Karl

--
http://www.openmymind.net/

"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:C3219EE8-856F-4861-8CDA-9E35C46F671E@.microsoft.com...
> ok thanks for the reply. I thought all of that code was generated
> automatically when you put the control on the form.
> --
> Paul G
> Software engineer.
>
> "Karl Seguin [MVP]" wrote:
>> assuming this is 1.x, you'll need to go in our codebehind, expand the
>> desiner region and add
>>
>> protected DropDownList controlId;
>>
>> like
>>
>> protected DropDownList States;
>>
>> you should see other similar controls there..
>>
>> Karl
>>
>> --
>> MY ASP.Net tutorials
>> http://www.openmymind.net/
>>
>>
>> "Paul" <Paul@.discussions.microsoft.com> wrote in message
>> news:BEC317EE-DAEB-4BA7-908A-4036BB9F5CB6@.microsoft.com...
>> >I added a textbox to a c# page and can access it with code behind but
>> >added
>> >a
>> > dropdown list by draging it on the page from the toolbar but when
>> > typing
>> > this. the dropdown id is not selectable and I can not access any of its
>> > attributes.
>> > --
>> > Paul G
>> > Software engineer.
>>
>>
>

Thursday, March 22, 2012

Thoughts on getting away from so many aspx files....

Hi,

I have been working on a web project since the very early .net 2.0 days - around 13 months now but it seems to be getting very bulky. I have dozens of aspx files and many folders containing them! I also have way too many files in app_code.

I was thinking maybe I need single entry page - maybe written as a http handler which decides what to do and then loads content xml files to generate output. My concern here is I loose the benefits of master pages - I guess I could store all the xml files in the db but maintenance is harder then.

Any suggestions on this? What about the ever growing app_code folder?

Thanks

-c

what makes the concern for the number of files? Sure you could combine them, but isn't that going to make maintenance harder, instead of easier?

As for the pages themselves (the .aspx). If you want a different look on each, you'll have to use some custom skinning (css) and dynamic content. This will mean either lots of .css files and/or lots in the DB (or xmls) to layout each page. Not really going to save yourself anything...

As for the app_code.. same thing.. you can combine, but will it save you anything? Proper use of Master Pages, base pages and inheritance will get rid of A LOT of the code within the files, but as long as you have custom pages, you'll need the files. Dynamically adding controls can help with some reusability, but in the end its often not worth the headaches...

Thread not working

I have a webpage which uploads a big file onto access db.
if the file is say around 30 megs, it'll take around a minute for it to get
put into the access db.
I didn't want the user to wait for it, so I decided to put it on a thread.
The thread works, but not the way it should.
One of my page will start the thread, and then forward the user to another
page.
The thread will start, and browser will get forwarded to the next page, BUT
as soon as I click anything in that second page, the response will be stuck
waiting until the thread processing the upload is done. Now that isn't very
much threaded now is it?...
Why is that happening? is putting stuff on the access db a process that has
to be done alone and can't be threaded?
ThxJason,
Actually the Thread will die if the page that created the thread is
destroyed. Use a webservice or Ajax to accomplished that.
Cheers
Al
"Jason Chu" wrote:

> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to ge
t
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BU
T
> as soon as I click anything in that second page, the response will be stuc
k
> waiting until the thread processing the upload is done. Now that isn't ve
ry
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that ha
s
> to be done alone and can't be threaded?
> Thx
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to ge
t
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BU
T
> as soon as I click anything in that second page, the response will be stuc
k
> waiting until the thread processing the upload is done. Now that isn't ve
ry
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that ha
s
> to be done alone and can't be threaded?
> Thx
I have heard that IIS queues requests per session. So a second request
within the same session would only be serviced after the first has
completed. (which seems to be the behavior you are seeing)
Hans Kesting
thanx for reply.
As for AJAX, I don't really wanna, cuz all the codes are all done and good
to go in C# (plus there's many components involved...it's just all tied up)
.
As for Webservices...will that make the processing totally separate from the
other processes from the pages (ie button clicks)? I believe both page
actions and webservices are handled by the same asp.net process. if
threading the database process in a page didn't make it separate (since it
hogged up the whole asp.net process), won't putting it on the webservice do
the same thing? (ie asp.net handles the webservice in another of its own
thread, but that thread hogs up the entire asp.net process, so the page
actions have to wait)
I don't want to move all my code to webservices unless I know that it'll
improve it.
"Albert Pascual" wrote:
> Jason,
> Actually the Thread will die if the page that created the thread is
> destroyed. Use a webservice or Ajax to accomplished that.
> Cheers
> Al
> "Jason Chu" wrote:
>
Thanks for replying.
Before I've put the upload processing function into a thread, I did some
tests with multiple users.
If one of that big upload occurs (so it'll take a minute to process), the
other users will still be able to move around the application for a little
bit, but will be stuck needing to wait after several clicks on the page.
For example
So if A initiate the 1 minute process.
B will be able to surf around for a bit, then after several postbacks, the
next postback will be stuck needing to wait for A's process to finish first
before a response comes back.
Kind of feels like asp.net has a buffer for B to move in...and as soon as
that buffer runs out, B will have to wait.
"Hans Kesting" wrote:

> I have heard that IIS queues requests per session. So a second request
> within the same session would only be serviced after the first has
> completed. (which seems to be the behavior you are seeing)
> Hans Kesting
>
>
How do you start the thread?
Should not be a problem if you are using Thread class.
George
"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6FA4D
E02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
I have a webpage which uploads a big file onto access db.
if the file is say around 30 megs, it'll take around a minute for it to get
put into the access db.
I didn't want the user to wait for it, so I decided to put it on a thread.
The thread works, but not the way it should.
One of my page will start the thread, and then forward the user to another
page.
The thread will start, and browser will get forwarded to the next page, BUT
as soon as I click anything in that second page, the response will be stuck
waiting until the thread processing the upload is done. Now that isn't very
much threaded now is it?...
Why is that happening? is putting stuff on the access db a process that has
to be done alone and can't be threaded?
Thx
ProcessorContainer pc = new ProcessorContainer(parameters);
Thread thread = new Thread(new ThreadStart(pc.ProcessUpload));
thread.Start();
simple enough
: )
but if i were to have a problem, then the thread won't even start.
remind you, that the big processing part is shoving the file into the access
db, so the one line causing the wait is the ExecuteNonQuery() of the
OleDbCommand.
"George" wrote:

> How do you start the thread?
> Should not be a problem if you are using Thread class.
>
> George
> "Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6
FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to
get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a threa
d.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to anoth
er
> page.
> The thread will start, and browser will get forwarded to the next page,
BUT
> as soon as I click anything in that second page, the response will be st
uck
> waiting until the thread processing the upload is done. Now that isn't
very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that
has
> to be done alone and can't be threaded?
> Thx
I think you have problem somewhere else. Whatever you are doing with threads
looks correct. You might post the whole code for your Page object.
Here are the facts that might help you figure out where problem is.
Session is locked during ASP.NET called. So only one request for one session
can come in. Second request (with same SessionID) will be queued.
The page must run through the whole lifecycle in order for Session object to
be unlocked for next request.
Response.Redirect( url ) or Response.Redirect( url, true ) will terminate pa
ge thus ending it's lifecycle.
Response.Redirect( url, false) will not end the lifecycle you can still be b
locking the session.
----
--
I would replace redirect with Response.Write("AAA") and then see if the IE l
ogo in right top corner is spinning.
If it is that means the page is hanging somewhere.
Hope that helps./
George.
"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:FA42C
AAD-EB92-456D-B00B-BC75C1F608CC@.microsoft.com...
ProcessorContainer pc = new ProcessorContainer(parameters);
Thread thread = new Thread(new ThreadStart(pc.ProcessUpload));
thread.Start();
simple enough
: )
but if i were to have a problem, then the thread won't even start.
remind you, that the big processing part is shoving the file into the access
db, so the one line causing the wait is the ExecuteNonQuery() of the
OleDbCommand.
"George" wrote:

> How do you start the thread?
> Should not be a problem if you are using Thread class.
>
>
> George
>
> "Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6
FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to
get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a threa
d.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to anoth
er
> page.
> The thread will start, and browser will get forwarded to the next page,
BUT
> as soon as I click anything in that second page, the response will be st
uck
> waiting until the thread processing the upload is done. Now that isn't
very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that
has
> to be done alone and can't be threaded?
> Thx
you have the correct approach. nothing in asp.net will cause the behavior
you are seeing, it must be your code forcing serialization. maybe you are
hitting locking problems with the db.
-- bruce (sqlwork.com)
"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message
news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
>I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to
> get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page,
> BUT
> as soon as I click anything in that second page, the response will be
> stuck
> waiting until the thread processing the upload is done. Now that isn't
> very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that
> has
> to be done alone and can't be threaded?
> Thx

Thread not working

I have a webpage which uploads a big file onto access db.
if the file is say around 30 megs, it'll take around a minute for it to get
put into the access db.
I didn't want the user to wait for it, so I decided to put it on a thread.
The thread works, but not the way it should.
One of my page will start the thread, and then forward the user to another
page.
The thread will start, and browser will get forwarded to the next page, BUT
as soon as I click anything in that second page, the response will be stuck
waiting until the thread processing the upload is done. Now that isn't very
much threaded now is it?...
Why is that happening? is putting stuff on the access db a process that has
to be done alone and can't be threaded?
ThxJason,

Actually the Thread will die if the page that created the thread is
destroyed. Use a webservice or Ajax to accomplished that.

Cheers
Al

"Jason Chu" wrote:

> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BUT
> as soon as I click anything in that second page, the response will be stuck
> waiting until the thread processing the upload is done. Now that isn't very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that has
> to be done alone and can't be threaded?
> Thx
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BUT
> as soon as I click anything in that second page, the response will be stuck
> waiting until the thread processing the upload is done. Now that isn't very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that has
> to be done alone and can't be threaded?
> Thx

I have heard that IIS queues requests per session. So a second request
within the same session would only be serviced after the first has
completed. (which seems to be the behavior you are seeing)

Hans Kesting
thanx for reply.

As for AJAX, I don't really wanna, cuz all the codes are all done and good
to go in C# (plus there's many components involved...it's just all tied up).
As for Webservices...will that make the processing totally separate from the
other processes from the pages (ie button clicks)? I believe both page
actions and webservices are handled by the same asp.net process. if
threading the database process in a page didn't make it separate (since it
hogged up the whole asp.net process), won't putting it on the webservice do
the same thing? (ie asp.net handles the webservice in another of its own
thread, but that thread hogs up the entire asp.net process, so the page
actions have to wait)
I don't want to move all my code to webservices unless I know that it'll
improve it.

"Albert Pascual" wrote:

> Jason,
> Actually the Thread will die if the page that created the thread is
> destroyed. Use a webservice or Ajax to accomplished that.
> Cheers
> Al
> "Jason Chu" wrote:
> > I have a webpage which uploads a big file onto access db.
> > if the file is say around 30 megs, it'll take around a minute for it to get
> > put into the access db.
> > I didn't want the user to wait for it, so I decided to put it on a thread.
> > The thread works, but not the way it should.
> > One of my page will start the thread, and then forward the user to another
> > page.
> > The thread will start, and browser will get forwarded to the next page, BUT
> > as soon as I click anything in that second page, the response will be stuck
> > waiting until the thread processing the upload is done. Now that isn't very
> > much threaded now is it?...
> > Why is that happening? is putting stuff on the access db a process that has
> > to be done alone and can't be threaded?
> > Thx
Thanks for replying.

Before I've put the upload processing function into a thread, I did some
tests with multiple users.
If one of that big upload occurs (so it'll take a minute to process), the
other users will still be able to move around the application for a little
bit, but will be stuck needing to wait after several clicks on the page.
For example
So if A initiate the 1 minute process.
B will be able to surf around for a bit, then after several postbacks, the
next postback will be stuck needing to wait for A's process to finish first
before a response comes back.
Kind of feels like asp.net has a buffer for B to move in...and as soon as
that buffer runs out, B will have to wait.

"Hans Kesting" wrote:

> > I have a webpage which uploads a big file onto access db.
> > if the file is say around 30 megs, it'll take around a minute for it to get
> > put into the access db.
> > I didn't want the user to wait for it, so I decided to put it on a thread.
> > The thread works, but not the way it should.
> > One of my page will start the thread, and then forward the user to another
> > page.
> > The thread will start, and browser will get forwarded to the next page, BUT
> > as soon as I click anything in that second page, the response will be stuck
> > waiting until the thread processing the upload is done. Now that isn't very
> > much threaded now is it?...
> > Why is that happening? is putting stuff on the access db a process that has
> > to be done alone and can't be threaded?
> > Thx
> I have heard that IIS queues requests per session. So a second request
> within the same session would only be serviced after the first has
> completed. (which seems to be the behavior you are seeing)
> Hans Kesting
>
How do you start the thread?
Should not be a problem if you are using Thread class.

George

"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
I have a webpage which uploads a big file onto access db.
if the file is say around 30 megs, it'll take around a minute for it to get
put into the access db.
I didn't want the user to wait for it, so I decided to put it on a thread.
The thread works, but not the way it should.
One of my page will start the thread, and then forward the user to another
page.
The thread will start, and browser will get forwarded to the next page, BUT
as soon as I click anything in that second page, the response will be stuck
waiting until the thread processing the upload is done. Now that isn't very
much threaded now is it?...
Why is that happening? is putting stuff on the access db a process that has
to be done alone and can't be threaded?
Thx
ProcessorContainer pc = new ProcessorContainer(parameters);
Thread thread = new Thread(new ThreadStart(pc.ProcessUpload));
thread.Start();

simple enough
: )

but if i were to have a problem, then the thread won't even start.

remind you, that the big processing part is shoving the file into the access
db, so the one line causing the wait is the ExecuteNonQuery() of the
OleDbCommand.

"George" wrote:

> How do you start the thread?
> Should not be a problem if you are using Thread class.
>
> George
> "Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BUT
> as soon as I click anything in that second page, the response will be stuck
> waiting until the thread processing the upload is done. Now that isn't very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that has
> to be done alone and can't be threaded?
> Thx
I think you have problem somewhere else. Whatever you are doing with threads looks correct. You might post the whole code for your Page object.

Here are the facts that might help you figure out where problem is.

Session is locked during ASP.NET called. So only one request for one session can come in. Second request (with same SessionID) will be queued.

The page must run through the whole lifecycle in order for Session object to be unlocked for next request.

Response.Redirect( url ) or Response.Redirect( url, true ) will terminate page thus ending it's lifecycle.
Response.Redirect( url, false) will not end the lifecycle you can still be blocking the session.

---------------------------

I would replace redirect with Response.Write("AAA") and then see if the IE logo in right top corner is spinning.
If it is that means the page is hanging somewhere.

Hope that helps./

George.

"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:FA42CAAD-EB92-456D-B00B-BC75C1F608CC@.microsoft.com...
ProcessorContainer pc = new ProcessorContainer(parameters);
Thread thread = new Thread(new ThreadStart(pc.ProcessUpload));
thread.Start();

simple enough
: )

but if i were to have a problem, then the thread won't even start.

remind you, that the big processing part is shoving the file into the access
db, so the one line causing the wait is the ExecuteNonQuery() of the
OleDbCommand.

"George" wrote:

> How do you start the thread?
> Should not be a problem if you are using Thread class.
>
>
> George
>
> "Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
> I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page, BUT
> as soon as I click anything in that second page, the response will be stuck
> waiting until the thread processing the upload is done. Now that isn't very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that has
> to be done alone and can't be threaded?
> Thx
you have the correct approach. nothing in asp.net will cause the behavior
you are seeing, it must be your code forcing serialization. maybe you are
hitting locking problems with the db.

-- bruce (sqlwork.com)

"Jason Chu" <JasonChu@.discussions.microsoft.com> wrote in message
news:6FA4DE02-436E-4C10-99A2-B0AE0F758DB5@.microsoft.com...
>I have a webpage which uploads a big file onto access db.
> if the file is say around 30 megs, it'll take around a minute for it to
> get
> put into the access db.
> I didn't want the user to wait for it, so I decided to put it on a thread.
> The thread works, but not the way it should.
> One of my page will start the thread, and then forward the user to another
> page.
> The thread will start, and browser will get forwarded to the next page,
> BUT
> as soon as I click anything in that second page, the response will be
> stuck
> waiting until the thread processing the upload is done. Now that isn't
> very
> much threaded now is it?...
> Why is that happening? is putting stuff on the access db a process that
> has
> to be done alone and can't be threaded?
> Thx

Thread not starting

Hi,

i am building an ASP.NET web project with J#.
I have the problem, that a Threads run() method isn't
invoked after Thread.start().
It's working in one project, but it isn't in an other one.

Are there any settings involved in this ?

regards,

grkanPlease post your code and I'll have a look.

L.

"Grkan Demirci" <fake_email@.host.de> wrote in message
news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
> Hi,
> i am building an ASP.NET web project with J#.
> I have the problem, that a Threads run() method isn't
> invoked after Thread.start().
> It's working in one project, but it isn't in an other one.
> Are there any settings involved in this ?
>
> regards,
> grkan
The code is realy simple to check the behaviour.

static public volatile boolean isStarted = false;

static public void run()

{

isStarted = true;

}

protected void Application_Start(Object sender, System.EventArgs e)

{

System.Threading.Thread t = new System.Threading.Thread(new
System.Threading.ThreadStart(run));

t.set_Priority(System.Threading.ThreadPriority.Low est);

t.Start();

while ( !isStarted );

}

run() is never been invoked. The applications hangs in while(isStarted).

regards,

grkan

"Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
> Please post your code and I'll have a look.
> L.
> "Grkan Demirci" <fake_email@.host.de> wrote in message
> news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
>> Hi,
>>
>> i am building an ASP.NET web project with J#.
>> I have the problem, that a Threads run() method isn't
>> invoked after Thread.start().
>> It's working in one project, but it isn't in an other one.
>>
>> Are there any settings involved in this ?
>>
>>
>> regards,
>>
>> grkan
>>
>>
that won't give you the results you are looking for because the application
start event only fires once. put the code in the page load event of the
webpage or leave the code where it is and re-start IIS. it should work then

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @. www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-----------------

"Grkan Demirci" <fake_email@.host.de> wrote in message
news:unubkzOxFHA.2976@.TK2MSFTNGP10.phx.gbl...
> The code is realy simple to check the behaviour.
> static public volatile boolean isStarted = false;
> static public void run()
> {
> isStarted = true;
> }
> protected void Application_Start(Object sender, System.EventArgs e)
> {
> System.Threading.Thread t = new System.Threading.Thread(new
> System.Threading.ThreadStart(run));
> t.set_Priority(System.Threading.ThreadPriority.Low est);
> t.Start();
> while ( !isStarted );
> }
> run() is never been invoked. The applications hangs in while(isStarted).
> regards,
> grkan
>
> "Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
> news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
> > Please post your code and I'll have a look.
> > L.
> > "Grkan Demirci" <fake_email@.host.de> wrote in message
> > news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
> >> Hi,
> >>
> >> i am building an ASP.NET web project with J#.
> >> I have the problem, that a Threads run() method isn't
> >> invoked after Thread.start().
> >> It's working in one project, but it isn't in an other one.
> >>
> >> Are there any settings involved in this ?
> >>
> >>
> >> regards,
> >>
> >> grkan
> >>
> >>
My guess would be this - you set the thread's priority to lowest then you go
into a tight loop in the main thread. Should you sleep for a milli second or
two in the main thread inside the loop, then the thread should be able to
execute.

"Grkan Demirci" <fake_email@.host.de> wrote in message
news:unubkzOxFHA.2976@.TK2MSFTNGP10.phx.gbl...
> The code is realy simple to check the behaviour.
> static public volatile boolean isStarted = false;
> static public void run()
> {
> isStarted = true;
> }
> protected void Application_Start(Object sender, System.EventArgs e)
> {
> System.Threading.Thread t = new System.Threading.Thread(new
> System.Threading.ThreadStart(run));
> t.set_Priority(System.Threading.ThreadPriority.Low est);
> t.Start();
> while ( !isStarted );
> }
> run() is never been invoked. The applications hangs in while(isStarted).
> regards,
> grkan
>
> "Landley" <news@.creations-software.co.uk> schrieb im Newsbeitrag
> news:%23d5pBnOxFHA.2848@.TK2MSFTNGP15.phx.gbl...
>> Please post your code and I'll have a look.
>>
>> L.
>>
>> "Grkan Demirci" <fake_email@.host.de> wrote in message
>> news:OjlHe%23NxFHA.3756@.tk2msftngp13.phx.gbl...
>>> Hi,
>>>
>>> i am building an ASP.NET web project with J#.
>>> I have the problem, that a Threads run() method isn't
>>> invoked after Thread.start().
>>> It's working in one project, but it isn't in an other one.
>>>
>>> Are there any settings involved in this ?
>>>
>>>
>>> regards,
>>>
>>> grkan
>>>
>>>
>>
>>

Tuesday, March 13, 2012

thread status created from asp.net

Hello,
I am sending 13000 emails alerts out using the thread from my asp.net
application. It is working smooth when I did the first and second
sending. but when I tried the third one, the server is so slow, the
thread is supposed to be abort normally each time.do you think it is
the thread I created from the first two times still alive, how could I
check thread status?
Thanks.
Ginnyyou should create a static collection to contain the threads, you can
harvest the status, or kill ones that ran too long. you might want to start
a management thread also.
-- bruce (sqlwork.com)
"ginny" <im_wang@.yahoo.com> wrote in message
news:1159292119.881690.324060@.b28g2000cwb.googlegroups.com...
> Hello,
> I am sending 13000 emails alerts out using the thread from my asp.net
> application. It is working smooth when I did the first and second
> sending. but when I tried the third one, the server is so slow, the
> thread is supposed to be abort normally each time.do you think it is
> the thread I created from the first two times still alive, how could I
> check thread status?
> Thanks.
> Ginny
>
bruce:
I am new to thread, how to create a static collection to contain the
threads?
The function in my thread is really simple, it loop 13000 times to send
13000 emails.
Thanks.
Ginny
(sqlwork.com) wrote:
> you should create a static collection to contain the threads, you can
> harvest the status, or kill ones that ran too long. you might want to star
t
> a management thread also.
> -- bruce (sqlwork.com)
> "ginny" <im_wang@.yahoo.com> wrote in message
> news:1159292119.881690.324060@.b28g2000cwb.googlegroups.com...

thread status created from asp.net

Hello,

I am sending 13000 emails alerts out using the thread from my asp.net
application. It is working smooth when I did the first and second
sending. but when I tried the third one, the server is so slow, the
thread is supposed to be abort normally each time.do you think it is
the thread I created from the first two times still alive, how could I
check thread status?

Thanks.

Ginnyyou should create a static collection to contain the threads, you can
harvest the status, or kill ones that ran too long. you might want to start
a management thread also.

-- bruce (sqlwork.com)

"ginny" <im_wang@.yahoo.comwrote in message
news:1159292119.881690.324060@.b28g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

Hello,
>
I am sending 13000 emails alerts out using the thread from my asp.net
application. It is working smooth when I did the first and second
sending. but when I tried the third one, the server is so slow, the
thread is supposed to be abort normally each time.do you think it is
the thread I created from the first two times still alive, how could I
check thread status?
>
Thanks.
>
Ginny
>


bruce:

I am new to thread, how to create a static collection to contain the
threads?
The function in my thread is really simple, it loop 13000 times to send
13000 emails.

Thanks.

Ginny

(sqlwork.com) wrote:

Quote:

Originally Posted by

you should create a static collection to contain the threads, you can
harvest the status, or kill ones that ran too long. you might want to start
a management thread also.
>
-- bruce (sqlwork.com)
>
"ginny" <im_wang@.yahoo.comwrote in message
news:1159292119.881690.324060@.b28g2000cwb.googlegr oups.com...

Quote:

Originally Posted by

Hello,

I am sending 13000 emails alerts out using the thread from my asp.net
application. It is working smooth when I did the first and second
sending. but when I tried the third one, the server is so slow, the
thread is supposed to be abort normally each time.do you think it is
the thread I created from the first two times still alive, how could I
check thread status?

Thanks.

Ginny

Thread was being aborted

I am developing a web application Using VB.NET, the application was working correctly, and suddenly i got this error message
"Thread was being aborted"
any body know how can i know what the problem is.

Best regards.
WafiNETAre you using Try/Catch blocks? If so, do you have a Response.Redirect inside a Catch block?
Yes, Iam uisng Try Catch and i am using Respone.Redirect