Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Saturday, March 31, 2012

Submitting a web form to a web server from a running windows servive.

hi and help. i have a windows service, in wich i want to submite a web from to a web server with some hidden fiels. how do i do this. and afterwords how can i get response from web server in windows service.
----------
From: Muhammad Saifullah

--------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>i6K//UAKUk2P/CaV2/rNFA==</Id>look up HttpWebRequest

Submitting a web form to a web server from a running windows servive.

hi and help. i have a windows service, in wich i want to submite a web from
to a web server with some hidden fiels. how do i do this. and afterwords how
can i get response from web server in windows service.
--
From: Muhammad Saifullah
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>i6K//UAKUk2P/CaV2/rNFA==</Id>look up HttpWebRequest

Submitting form from the Server Control

Hi,

the form data exists in the Request.Form collection. how do you mavigate
from Page1 to Page2?
if you use server.transfer make sure the the secound parameter set to
true otherwise the Form wont redirect to Page2.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi,

Thanks for the info. I was using Response.Redirect to redirect to the next
page. Because of that I was not getting the submitted value.

Regards

Pradeep

"Natty Gur" <natty@.dao2com.com> wrote in message
news:uBoQVf7ZDHA.1744@.TK2MSFTNGP12.phx.gbl...
> Hi,
> the form data exists in the Request.Form collection. how do you mavigate
> from Page1 to Page2?
> if you use server.transfer make sure the the secound parameter set to
> true otherwise the Form wont redirect to Page2.
> Natty Gur, CTO
> Dao2Com Ltd.
> 34th Elkalay st. Raanana
> Israel , 43000
> Phone Numbers:
> Office: +972-(0)9-7740261
> Fax: +972-(0)9-7740261
> Mobile: +972-(0)58-888377
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Hi,

One more thing. When i use Server.Transfer, the URL of the IE doesn't get
updated with the current form. Also it always displays the URL of the last
Form.

Any idea ?

Pradeep

"Natty Gur" <natty@.dao2com.com> wrote in message
news:uBoQVf7ZDHA.1744@.TK2MSFTNGP12.phx.gbl...
> Hi,
> the form data exists in the Request.Form collection. how do you mavigate
> from Page1 to Page2?
> if you use server.transfer make sure the the secound parameter set to
> true otherwise the Form wont redirect to Page2.
> Natty Gur, CTO
> Dao2Com Ltd.
> 34th Elkalay st. Raanana
> Israel , 43000
> Phone Numbers:
> Office: +972-(0)9-7740261
> Fax: +972-(0)9-7740261
> Mobile: +972-(0)58-888377
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Submitting form from the Server Control

Dear All,

How can I submit the whole form data when I click on the "ASP Server
Button". I want to use the Posted data in the redirect form.

Regards

PradeepHi,

What "whole form data means. Every form submits already sending all
the Input values to the server by default. If you want the entire HTML
add invisible Input box and put the body innerhtml in that input box
before submitting.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Submitting IFrame in asp.net

hi
I have this situation where I need to do some server side execution
without posting the page.
I used to do this in asp using IFrame, but it's not working in asp.net.
I had a form and iframe element in the web page as follow:
<form id=MainForm ...>
this is the form that the user see
</form>
<form id= myForm method=post action="form.aspx" target="myHiddenFrame">
<input type=hidden id=hiddenField>
</form>
<iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
style="width:0px; height:0px; border: 0px"></iframe>
then I had a javascript function: window.myForm.submit();
It seems that i can't put target="myHiddenFrame", the target can only be
_self, _parent...
How can I submit in an IFrame element ?
regards
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!iframe is working in asp.net in the regular way. It just has to sit inside a
form. And there can be only one form in a page. And there should be
runat=server set for the form tag.
Eliyahu
"Naim" <anonymous@.devdex.com> wrote in message
news:%23YXooBz7EHA.3592@.TK2MSFTNGP09.phx.gbl...
> hi
> I have this situation where I need to do some server side execution
> without posting the page.
> I used to do this in asp using IFrame, but it's not working in asp.net.
> I had a form and iframe element in the web page as follow:
> <form id=MainForm ...>
> this is the form that the user see
> </form>
> <form id= myForm method=post action="form.aspx" target="myHiddenFrame">
> <input type=hidden id=hiddenField>
> </form>
> <iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
> style="width:0px; height:0px; border: 0px"></iframe>
> then I had a javascript function: window.myForm.submit();
> It seems that i can't put target="myHiddenFrame", the target can only be
> _self, _parent...
> How can I submit in an IFrame element ?
> regards
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!

Submitting IFrame in asp.net

hi

I have this situation where I need to do some server side execution
without posting the page.
I used to do this in asp using IFrame, but it's not working in asp.net.

I had a form and iframe element in the web page as follow:
<form id=MainForm ...>
this is the form that the user see
</form>
<form id= myForm method=post action="form.aspx" target="myHiddenFrame">
<input type=hidden id=hiddenField>
</form
<iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
style="width:0px; height:0px; border: 0px"></iframe
then I had a javascript function: window.myForm.submit();

It seems that i can't put target="myHiddenFrame", the target can only be
_self, _parent...

How can I submit in an IFrame element ?

regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!iframe is working in asp.net in the regular way. It just has to sit inside a
form. And there can be only one form in a page. And there should be
runat=server set for the form tag.

Eliyahu

"Naim" <anonymous@.devdex.com> wrote in message
news:%23YXooBz7EHA.3592@.TK2MSFTNGP09.phx.gbl...
> hi
> I have this situation where I need to do some server side execution
> without posting the page.
> I used to do this in asp using IFrame, but it's not working in asp.net.
> I had a form and iframe element in the web page as follow:
> <form id=MainForm ...>
> this is the form that the user see
> </form>
> <form id= myForm method=post action="form.aspx" target="myHiddenFrame">
> <input type=hidden id=hiddenField>
> </form>
> <iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
> style="width:0px; height:0px; border: 0px"></iframe>
> then I had a javascript function: window.myForm.submit();
> It seems that i can't put target="myHiddenFrame", the target can only be
> _self, _parent...
> How can I submit in an IFrame element ?
> regards
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Submitting whole HTML document to Server

Is there a way to return the whole HTML document from the Client to
the Server "as is" so I can use ASP.NET to parse through it and look
for stuff?
I want to see what some client side JavaScript may have done to the
XHTML document."GMartin" <glenn.e.martin@.gmail.com> wrote in message
news:d9443226-88cf-4bb0-b1d6-4f9514c0ab02@.j20g2000hsi.googlegroups.com...
> Is there a way to return the whole HTML document from the Client to
> the Server "as is" so I can use ASP.NET to parse through it and look
> for stuff?
> I want to see what some client side JavaScript may have done to the
> XHTML document.
This doesn't directly answer your question, but it may be what you are
looking for.
http://projects.nikhilk.net/Projects/WebDevHelper.aspx
In addition to its many other features, it will show you the "live" HTML
source for a page (as modified by any javascript).
I'm looking to do it at runtime. Not with a utility while
programming.
On Feb 11, 1:31 pm, "Scott Roberts" <srobe...@.no.spam.here-webworks-
software.com> wrote:
> "GMartin" <glenn.e.mar...@.gmail.com> wrote in message
> news:d9443226-88cf-4bb0-b1d6-4f9514c0ab02@.j20g2000hsi.googlegroups.com...
>
>
> This doesn't directly answer your question, but it may be what you are
> looking for.
> http://projects.nikhilk.net/Projects/WebDevHelper.aspx
> In addition to its many other features, it will show you the "live" HTML
> source for a page (as modified by any javascript).

Wednesday, March 28, 2012

substitute for nested select query

I have a series of select queries that use the nesting method but are
creating such a huge query that the server can't handle it. The IN section
in some cases are so large that I can't even troubleshoot it in Query
Analyzer because it's larger than 64k. Is there another way to write:

SELECT t1.col1, t1.col2
FROM table1 t1
WHERE EXISTS
(
SELECT t2.col1, t2.col2
FROM table2 t2
WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
list items here>
)

_____
DC GWHy dont you store them in a table ? Would be much easier to maintain, you
ould additionaly activate / deactivate some entries here:

Create Tabel MyValues
(
MyValue varchar(200),
Acitvated bit
)

SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN
(Select * from myVales where Activated =1 )

HTH, Jens Suessmeyer.

--
http://www.sqlserver2005.de
--

"DC Gringo" <dcgringo@.visiontechnology.net> schrieb im Newsbeitrag
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
Create a table with the values (one column, multiple rows) and do a subquery inside your IN (or
EXISTS).

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/

"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are creating such a huge query
>that the server can't handle it. The IN section in some cases are so large that I can't even
>troubleshoot it in Query Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of list items here>
> )
> _____
> DC G
First of all, no need to post a question to all the groups in your
subscription list.
You should have posted only to microsoft.public.sqlserver.programming

How is the list being passed into the query?

Take a look at:
http://vyaskn.tripod.com/passing_ar..._procedures.htm

It may give you a few ideas on how to deal with this.

"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
DC Gringo,

The example posted is not using a correlated subquery, the is not a relation
between table1 and table2. Idf it is correct, then you can rewrite it as:

if exists(select * from table2 where col2 in (...))
select col1, col2 from table1

if it was a typo error, then you can create a temporary table to insert the
values in the list, with an associated index and use:

create table #t (c1 int)

insert into #t values(...)
...
create nonclustered index ix_#t_c1 on #t(c1)

SELECT
t1.col1, t1.col2
FROM
table1 as t1
inner join
(
select
t2.col1
from
table2 as t2
inner join
#t
on #t.c1 = t2.col1
) as t3
on t1.col1 = t3.col1

drop table #t
go

AMB

"DC Gringo" wrote:

> I have a series of select queries that use the nesting method but are
> creating such a huge query that the server can't handle it. The IN section
> in some cases are so large that I can't even troubleshoot it in Query
> Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
>
>
Raymond, frankly I didn't expect a SQL T-sql answer. I was expecting a
vb.NET answer...but figured I'd try both...I am passing it in via raw SQL
from a .vb component. It is a query building application.

_____
DC G

"Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
news:uTm7J%23%23TFHA.952@.TK2MSFTNGP10.phx.gbl...
> First of all, no need to post a question to all the groups in your
> subscription list.
> You should have posted only to microsoft.public.sqlserver.programming
> How is the list being passed into the query?
> Take a look at:
> http://vyaskn.tripod.com/passing_ar..._procedures.htm
> It may give you a few ideas on how to deal with this.
> "DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
> news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>>I have a series of select queries that use the nesting method but are
>>creating such a huge query that the server can't handle it. The IN
>>section in some cases are so large that I can't even troubleshoot it in
>>Query Analyzer because it's larger than 64k. Is there another way to
>>write:
>>
>> SELECT t1.col1, t1.col2
>> FROM table1 t1
>> WHERE EXISTS
>> (
>> SELECT t2.col1, t2.col2
>> FROM table2 t2
>> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
>> list items here>
>> )
>>
>> _____
>> DC G
>>
>>
>>
Hey DC,

If you have rights to create tables temprorarily, I'd agree with most of the
other posts. A few other ideas follow. Also, can you post more specifics
about what sort of things can be part of the IN clause?

- Are there any patterns you can narrow pieces down to, e.g., CAST( t2.col2
AS int) BETWEEN 1 AND 42?
- Maybe you could use the query to narrow the majority of your data and
either manipulate it on the .NET side or use a DataView to handle the rest
of the trimming.
- Can the logic be "reversed", e.g., if you can have char representations of
numbers ranging '1' to '10000', use NOT IN and supply a smaller set of
non-valid options.

HTH,

John

"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G

substitute for nested select query

I have a series of select queries that use the nesting method but are
creating such a huge query that the server can't handle it. The IN section
in some cases are so large that I can't even troubleshoot it in Query
Analyzer because it's larger than 64k. Is there another way to write:
SELECT t1.col1, t1.col2
FROM table1 t1
WHERE EXISTS
(
SELECT t2.col1, t2.col2
FROM table2 t2
WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
list items here>
)
_____
DC GWHy dont you store them in a table ? Would be much easier to maintain, you
ould additionaly activate / deactivate some entries here:
Create Tabel MyValues
(
MyValue varchar(200),
Acitvated bit
)
SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN
(Select * from myVales where Activated =1 )
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"DC Gringo" <dcgringo@.visiontechnology.net> schrieb im Newsbeitrag
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
>
>
Create a table with the values (one column, multiple rows) and do a subquery
inside your IN (or
EXISTS).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are creat
ing such a huge query
>that the server can't handle it. The IN section in some cases are so large
that I can't even
>troubleshoot it in Query Analyzer because it's larger than 64k. Is there a
nother way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of l
ist items here>
> )
> _____
> DC G
>
>
First of all, no need to post a question to all the groups in your
subscription list.
You should have posted only to microsoft.public.sqlserver.programming
How is the list being passed into the query?
Take a look at:
http://vyaskn.tripod.com/passing_ar..._procedures.htm
It may give you a few ideas on how to deal with this.
"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
>
>
DC Gringo,
The example posted is not using a correlated subquery, the is not a relation
between table1 and table2. Idf it is correct, then you can rewrite it as:
if exists(select * from table2 where col2 in (...))
select col1, col2 from table1
if it was a typo error, then you can create a temporary table to insert the
values in the list, with an associated index and use:
create table #t (c1 int)
insert into #t values(...)
...
create nonclustered index ix_#t_c1 on #t(c1)
SELECT
t1.col1, t1.col2
FROM
table1 as t1
inner join
(
select
t2.col1
from
table2 as t2
inner join
#t
on #t.c1 = t2.col1
) as t3
on t1.col1 = t3.col1
drop table #t
go
AMB
"DC Gringo" wrote:

> I have a series of select queries that use the nesting method but are
> creating such a huge query that the server can't handle it. The IN sectio
n
> in some cases are so large that I can't even troubleshoot it in Query
> Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
>
>
Raymond, frankly I didn't expect a SQL T-sql answer. I was expecting a
vb.NET answer...but figured I'd try both...I am passing it in via raw SQL
from a .vb component. It is a query building application.
_____
DC G
"Raymond D'Anjou" <rdanjou@.savantsoftNOSPAM.net> wrote in message
news:uTm7J%23%23TFHA.952@.TK2MSFTNGP10.phx.gbl...
> First of all, no need to post a question to all the groups in your
> subscription list.
> You should have posted only to microsoft.public.sqlserver.programming
> How is the list being passed into the query?
> Take a look at:
> http://vyaskn.tripod.com/passing_ar..._procedures.htm
> It may give you a few ideas on how to deal with this.
> "DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
> news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>
Hey DC,
If you have rights to create tables temprorarily, I'd agree with most of the
other posts. A few other ideas follow. Also, can you post more specifics
about what sort of things can be part of the IN clause?
- Are there any patterns you can narrow pieces down to, e.g., CAST( t2.col2
AS int) BETWEEN 1 AND 42?
- Maybe you could use the query to narrow the majority of your data and
either manipulate it on the .NET side or use a DataView to handle the rest
of the trimming.
- Can the logic be "reversed", e.g., if you can have char representations of
numbers ranging '1' to '10000', use NOT IN and supply a smaller set of
non-valid options.
HTH,
John
"DC Gringo" <dcgringo@.visiontechnology.net> wrote in message
news:e9nOtz%23TFHA.580@.TK2MSFTNGP15.phx.gbl...
>I have a series of select queries that use the nesting method but are
>creating such a huge query that the server can't handle it. The IN section
>in some cases are so large that I can't even troubleshoot it in Query
>Analyzer because it's larger than 64k. Is there another way to write:
> SELECT t1.col1, t1.col2
> FROM table1 t1
> WHERE EXISTS
> (
> SELECT t2.col1, t2.col2
> FROM table2 t2
> WHERE t2.col2 IN ('1','2','3','4'...<there could be thousands of
> list items here>
> )
> _____
> DC G
>
>

Suddenly aspnet_wp.exe memory builds up

A site we are moving from asp to asp.net has a weird problem. During slow
times it's fine and performs great, however when each server gets about 50
to 60 requests/sec, performance is still great but out of the blue the
memory usage goes from 200-300 mb aspnet_wp and keeps going until the
process gets recycled, it is then fine for a short while. We have made sure
there aren't any large datatables loading or any other sort of data that
could be building up. We also set the sql server to stop any with a cost
over 10 seconds for any connections coming from application. We can not
mimic this in our development environment, it only exists on our web farm of
three servers and it happens on all three servers sporadically. We can not
pin point it to any operation or page. However we are using a few COM
objects that have not been recoded in .NET yet such as jpeg manipulation and
encryption. Does anyone have any ideas how to pinpoint the problem, any ways
to determine what object or code is the culprit. This is still unnoticed by
our customers due to the sql state + load balancer and web farm.. but it
gets very expensive on the processors during busy times to have the
aspnet_wp restart as often as 10 minutes or so during heavy load times.

-Billare you disposing the unmanaged objects properly? a lot of the times, this
is the culprit. see about that first then have a look at the memory profiler
available from the framework to trace this issue. here is a link for further
troubleshooting
http://tinyurl.com/3dsxc

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Bill Green" <green_bill@.hotmail.com> wrote in message
news:O1Pzzvn3DHA.2612@.tk2msftngp13.phx.gbl...
> A site we are moving from asp to asp.net has a weird problem. During slow
> times it's fine and performs great, however when each server gets about 50
> to 60 requests/sec, performance is still great but out of the blue the
> memory usage goes from 200-300 mb aspnet_wp and keeps going until the
> process gets recycled, it is then fine for a short while. We have made
sure
> there aren't any large datatables loading or any other sort of data that
> could be building up. We also set the sql server to stop any with a cost
> over 10 seconds for any connections coming from application. We can not
> mimic this in our development environment, it only exists on our web farm
of
> three servers and it happens on all three servers sporadically. We can
not
> pin point it to any operation or page. However we are using a few COM
> objects that have not been recoded in .NET yet such as jpeg manipulation
and
> encryption. Does anyone have any ideas how to pinpoint the problem, any
ways
> to determine what object or code is the culprit. This is still unnoticed
by
> our customers due to the sql state + load balancer and web farm.. but it
> gets very expensive on the processors during busy times to have the
> aspnet_wp restart as often as 10 minutes or so during heavy load times.
> -Bill

Suddenly can't load assembly

I am using VS2005, and yesterday I copied a web site from my
development machine to
a Windows 2003 server, and the web site worked fine.
Today I made a few changes on my machine, and tried to repeat the
process,
but I get an error message:
Could not load file or assembly 'BaseRS' or one of its dependencies.
Access is denied
BaseRS.dll is in the bin folder, as it was previously.
Any ideas about what causes this message?What were the "few changes" you made ?
Anything to do with file permissions or the ASP.NET account ?
Did you enable impersonation and now a different account needs permissions ?
Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
<jhcorey@.yahoo.com> wrote in message news:1133453674.384226.289410@.z14g2000cwz.googlegroups
.com...
>I am using VS2005, and yesterday I copied a web site from my
> development machine to
> a Windows 2003 server, and the web site worked fine.
> Today I made a few changes on my machine, and tried to repeat the
> process,
> but I get an error message:
> Could not load file or assembly 'BaseRS' or one of its dependencies.
> Access is denied
> BaseRS.dll is in the bin folder, as it was previously.
> Any ideas about what causes this message?
>
Did you try IISReset before doing the deployment.
If not, you may like to do that. Also, clear all your Temporary Asp.net
files from the folder C:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files
before you deploy the application.
If that doesn't help you can try Filemon utility from www.sysinternals.com
and serch for access denied after you reproduce the error and save the log
file from the Filemon utility.
HTH
--
Cheers,
Rahul Soni
-->The secret to creativity is knowing how to hide your sources<--
"jhcorey@.yahoo.com" wrote:

> I am using VS2005, and yesterday I copied a web site from my
> development machine to
> a Windows 2003 server, and the web site worked fine.
> Today I made a few changes on my machine, and tried to repeat the
> process,
> but I get an error message:
> Could not load file or assembly 'BaseRS' or one of its dependencies.
> Access is denied
> BaseRS.dll is in the bin folder, as it was previously.
> Any ideas about what causes this message?
>
The app does use impersonation, and that may have been a change in the
web.config.
(Although it uses anonymous access, and yes there was a reason for this
that made sense at one point).
I can experiment without impersonation and see if that makes a
difference. What would I do if it does?
I'm not familiar with any new deployment procedures, so I figure I
better take a look in help.
But I assumed that copying the folders would work for deployment, as it
did in ASP.NET 1.
Anyway, I'll try Rahul's suggestions as well, thanks.
re:
> I can experiment without impersonation and see if that
> makes a difference. What would I do if it does?
Run this aspx page :
identity.aspx :
--
<%@. Page Language="VB" %>
<script runat="server">
Sub Page_Load(obj as object, e as eventargs)
Dim user as string = Environment.Username
lblUser.Text = user
End Sub
</script>
<html>
<body>
<asp:Label id="lblUser" runat="server"/></asp:Label>
</body>
</html>
--
That will tell you which account needs permission to the directory
where the BaseRS assembly is located ( the /bin dir, right ? ).
Juan T. Llibre
ASP.NET.FAQ : http://asp.net.do/faq/
ASPNETFAQ.COM : http://www.aspnetfaq.com/
Foros de ASP.NET en Espaol : http://asp.net.do/foros/
======================================
<jhcorey@.yahoo.com> wrote in message news:1133455339.559879.253270@.g44g2000cwa.googlegroups
.com...
> The app does use impersonation, and that may have been a change in the
> web.config.
> (Although it uses anonymous access, and yes there was a reason for this
> that made sense at one point).
> I can experiment without impersonation and see if that makes a
> difference. What would I do if it does?
> I'm not familiar with any new deployment procedures, so I figure I
> better take a look in help.
> But I assumed that copying the folders would work for deployment, as it
> did in ASP.NET 1.
> Anyway, I'll try Rahul's suggestions as well, thanks.
>
Juan,
Impersonation was indeed the issue. The impersonation user id is from
a different domain.
For some reason this did not cause a problem on my development machine.
I'm not sure if I should address this within the folder system or
within IIS6.
I tried changing the security on the folder (it already had 'Everyone'
with full control)
to give explicit access to this userid, but it didn't help.
Thanks,
Jim
Finally got this working (I think)
After quite a bit more playing around with security for impersonated
user,
I googled some more and saw that I had to grant permissions (full
control) on
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
and so I'm running...
Jim

Saturday, March 24, 2012

Suggestions: Filling calendar with db events

I have a bunch of events and appointments in a sql server db. What is the
best way to fill a calendar with this data? As I switch months I want it to
repopulate with the "current" months data.
I'd like it to kind of work like a basic Outlook calendar.
Thanks!1. Create a calendar interface in ASP.Net/HTML.
2. Populate it with data.
3. What exactly do you need help with?
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!
>
I have a calendar on the aspx page. How can I bind it to data that comes
from a sql server db?
Ex:
Event 1 - 12/1/2004
Event 2 - 12/3/2004
Event 3 - 12/5/2004
So, if you were to go on the calendar to Dec 2004 Event 1 would show up in
the 12/1 box, Event 2 in the 12/3 box, etc... If I switched the calendar to
January it would populate the calendar with January events.
Thanks Kevin.
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:ukQqNsT3EHA.2624@.TK2MSFTNGP11.phx.gbl...
> 1. Create a calendar interface in ASP.Net/HTML.
> 2. Populate it with data.
> 3. What exactly do you need help with?
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
> news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> to
>
check out these code samples:
http://aspnet101.com/aspnet101/aspn...?code=caltitles
http://aspnet101.com/aspnet101/aspn...spx?code=CalMdb
David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
Coming Soon - Data Management Toolkit
Manage MSDE/SQL Server/MySQL/MS Access Databases from one location.
http://augustwind.com/augustwind/dmt.aspx
"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!
>
(Sorry - the other link was supposed to be:
http://aspnet101.com/aspnet101/aspn...x?code=calendar)
David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
Coming Soon - Data Management Toolkit
Manage MSDE/SQL Server/MySQL/MS Access Databases from one location.
http://augustwind.com/augustwind/dmt.aspx
"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!
>

Suggestions: Filling calendar with db events

I have a bunch of events and appointments in a sql server db. What is the
best way to fill a calendar with this data? As I switch months I want it to
repopulate with the "current" months data.

I'd like it to kind of work like a basic Outlook calendar.

Thanks!1. Create a calendar interface in ASP.Net/HTML.
2. Populate it with data.
3. What exactly do you need help with?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!
I have a calendar on the aspx page. How can I bind it to data that comes
from a sql server db?

Ex:
Event 1 - 12/1/2004
Event 2 - 12/3/2004
Event 3 - 12/5/2004

So, if you were to go on the calendar to Dec 2004 Event 1 would show up in
the 12/1 box, Event 2 in the 12/3 box, etc... If I switched the calendar to
January it would populate the calendar with January events.

Thanks Kevin.

"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:ukQqNsT3EHA.2624@.TK2MSFTNGP11.phx.gbl...
> 1. Create a calendar interface in ASP.Net/HTML.
> 2. Populate it with data.
> 3. What exactly do you need help with?
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
> news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
>> I have a bunch of events and appointments in a sql server db. What is
>> the
>> best way to fill a calendar with this data? As I switch months I want it
> to
>> repopulate with the "current" months data.
>>
>> I'd like it to kind of work like a basic Outlook calendar.
>>
>> Thanks!
>>
>>
check out these code samples:
http://aspnet101.com/aspnet101/aspn...?code=caltitles
http://aspnet101.com/aspnet101/aspn...spx?code=CalMdb

David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
Coming Soon - Data Management Toolkit
Manage MSDE/SQL Server/MySQL/MS Access Databases from one location.
http://augustwind.com/augustwind/dmt.aspx

"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!
(Sorry - the other link was supposed to be:
http://aspnet101.com/aspnet101/aspn...x?code=calendar)

David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
Coming Soon - Data Management Toolkit
Manage MSDE/SQL Server/MySQL/MS Access Databases from one location.
http://augustwind.com/augustwind/dmt.aspx

"VB Programmer" <Dont*NoSpam-Please*@.jEmail.com> wrote in message
news:eC0CzfT3EHA.1264@.TK2MSFTNGP12.phx.gbl...
> I have a bunch of events and appointments in a sql server db. What is the
> best way to fill a calendar with this data? As I switch months I want it
to
> repopulate with the "current" months data.
> I'd like it to kind of work like a basic Outlook calendar.
> Thanks!

Summary of data in ASP.NET

hello

i am pretty new to asp.net and would like advice on how to best summarise data from an sql server database.

i have some data in a table, each record containing someones name and a 'type' field (contains positive or negative) among other stuff . i need to summarise the count of how many times a persons name appears in the table and display how many positive/negative entries there are.

i've used VB6 and VBA for ages and know how to do this by stepping through recordsets etc but want to know what the best approach is in ADO.NET, i'm still trying to get my head round data readers, datassets, data adapters, data tables etc.

any help is greatly appreciated
thanks
mickThis aggregation would probably be best left to your SQL engine of choice.

Based on the table:

PersonName varchar(50)
Active bit

With the values

PersonName Active
Tom 0
Tom 0
Tom 1
Jane 1
Jim 0

The query:

SELECT PersonName, COUNT(PersonName) HitCount, Active
FROM Person
GROUP BY PersonName, Active
ORDER BY PersonName

Should result in:

PersonName HitCount Active
Jane 1 1
Jim 1 0
Tom 2 0
Tom 1 1

From here, any tutorial on querying a database via SQL (a data reader should be fine) should apply.
thanks very much.

Thursday, March 22, 2012

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>

<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' +
answer")

line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.

What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?

rn5a@.rediffmail.com wrote:

Quote:

Originally Posted by

A custom server control has a Button.
>
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
>
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClic k,
"ConfirmMsg()")
End Sub
>
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
>
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
>
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
>
<%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
>
Note the
>
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
>
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
>
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=true
>
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
>
http://myserver/aspx/Confirm.aspx?Proceed=false
>
Can this be done in anyway?

Suppress Form Action

A custom server control has a Button.

Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property

Protected Overrides Sub AddAttributesToRender(ByVal Output As HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg()")
End Sub

Protected Overrides Sub RenderContents(ByVal Output As HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)

Output.Write("location.href = window.location.href + '?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace

Using VBC, I compiled the above intoConfirm.dll. This is how I am using the above custom control in an ASPX page (assume that the ASPX page is namedConfirm.aspx):

<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?" Text="EXIT" runat="server"/>
</form>

Note the

Output.Write("location.href = window.location.href + '?Proceed=' + answer")

line (which is highlighted) in the VB class file code. When the ASPX page gets rendered, it displays a Button. Conventionally, when a Button is clicked in an ASPX page, it posts back to itself using the POST method. When the Button in the above custom control is clicked, a JavaScriptconfirm dialog pops-up with 2 buttons -OK &Cancel. IfOK is clicked, the value of the JavaScript variableanswer istrue & ifCancel is clicked, the value of the variableanswer isfalse.

What I want is irrespective of whether a user clicks theOK orCancel button in theconfirm dialog, instead of posting back to itself using the conventional POST method, I want the ASPX page to post to itself BUT with a querystringProceed=<value> appended i.e. I want to suppress the conventional post & instead add the querystring so that I can find out whether the user has clicked theOK button or theCancel button in theconfirm dialog. If the user clicksOK, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

On the other hand, if the user clicksCancel in theconfirm dialog, he will be taken to

http://myserver/aspx/Confirm.aspx?Proceed=false

Can this be done in anyway?

Output.AddAttribute(HtmlTextWriterAttribute.OnClick, "ConfirmMsg();return false;")


Thanks, mate, your suggestion turned out to be a great one. Could you please tell me what role doesreturn=false; which you have appended afterConfirmMsg(), play here?

Going by your suggestion does add the querystringProceed=<value> at the end of the URL but there's a *** here. Suppose when a user clicks the server-side Button; he is shown the JavaScriptconfirm dialog with theOK &Cancel buttons. If the user clicksOK, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true

That's fine but if the user clicks the server-side Button once again & clicksCancel in theconfirm dialog, then he is taken to

http://myserver/aspx/Confirm.aspx?Proceed=true?Proceed=false

i.e. the querystring gets appended twice. In other words, a querystringProceed=<value> will go on getting appended at the URL wheneverOK &Cancel is clicked in the JavaScriptconfirm dialog. For e.g. if a user clicks eitherOK orCancel in theconfirm dialog 5 times, then the querystring will get appended one after the other 5 times.

Any workaround to overcome this?

Suppress Form Action

A custom server control has a Button.
Namespace Confirm
Public Class ShowConfirm : Inherits Button
Private strConfirmMsg As String
Public Property ConfirmMessage() As String
Get
ConfirmMessage = strConfirmMsg
End Get
Set(ByVal value As String)
strConfirmMsg = value
End Set
End Property
Protected Overrides Sub AddAttributesToRender(ByVal Output As
HtmlTextWriter)
MyBase.AddAttributesToRender(Output)
Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
"ConfirmMsg()")
End Sub
Protected Overrides Sub RenderContents(ByVal Output As
HtmlTextWriter)
Output.Write(vbCrLf)
Output.Write("<script language='JavaScript'>")
Output.Write(vbCrLf)
Output.Write("function ConfirmMsg(){")
Output.Write(vbCrLf)
Output.Write("var answer = confirm('")
Output.Write(strConfirmMsg)
Output.Write("')")
Output.Write(vbCrLf)
Output.Write("location.href = window.location.href +
'?Proceed=' + answer")
Output.Write(vbCrLf)
Output.Write("}")
Output.Write(vbCrLf)
Output.Write("</script>")
End Sub
End Class
End Namespace
Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
using the above custom control in an ASPX page (assume that the ASPX
page is named Confirm.aspx):
<%@dotnet.itags.org. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
<form EnableViewState="true" runat="server">
<CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
Text="EXIT" runat="server"/>
</form>
Note the
Output.Write("location.href = window.location.href + '?Proceed=' +
answer")
line in the VB class file code. When the ASPX page gets rendered, it
displays a Button. Conventionally, when a Button is clicked in an ASPX
page, it posts back to itself using the POST method. When the Button in
the above custom control is clicked, a JavaScript confirm dialog
pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
the value of the variable 'answer' is false.
What I want is irrespective of whether a user clicks the 'OK' or
'Cancel' button in the confirm dialog, instead of posting back to
itself using the conventional POST method, I want the ASPX page to post
to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
to suppress the conventional post & instead add the querystring so that
I can find out whether the user has clicked the 'OK' button or the
'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
be taken to
http://myserver/aspx/Confirm.aspx?Proceed=true
If the user clicks 'Cancel' in the confirm dialog, he will be taken to
http://myserver/aspx/Confirm.aspx?Proceed=false
Can this be done in anyway?Anyone?
rn5a@.rediffmail.com wrote:
> A custom server control has a Button.
> Namespace Confirm
> Public Class ShowConfirm : Inherits Button
> Private strConfirmMsg As String
> Public Property ConfirmMessage() As String
> Get
> ConfirmMessage = strConfirmMsg
> End Get
> Set(ByVal value As String)
> strConfirmMsg = value
> End Set
> End Property
> Protected Overrides Sub AddAttributesToRender(ByVal Output As
> HtmlTextWriter)
> MyBase.AddAttributesToRender(Output)
> Output.AddAttribute(HtmlTextWriterAttribute.OnClick,
> "ConfirmMsg()")
> End Sub
> Protected Overrides Sub RenderContents(ByVal Output As
> HtmlTextWriter)
> Output.Write(vbCrLf)
> Output.Write("<script language='JavaScript'>")
> Output.Write(vbCrLf)
> Output.Write("function ConfirmMsg(){")
> Output.Write(vbCrLf)
> Output.Write("var answer = confirm('")
> Output.Write(strConfirmMsg)
> Output.Write("')")
> Output.Write(vbCrLf)
> Output.Write("location.href = window.location.href +
> '?Proceed=' + answer")
> Output.Write(vbCrLf)
> Output.Write("}")
> Output.Write(vbCrLf)
> Output.Write("</script>")
> End Sub
> End Class
> End Namespace
> Using VBC, I compiled the above into 'Confirm.dll'. This is how I am
> using the above custom control in an ASPX page (assume that the ASPX
> page is named Confirm.aspx):
> <%@. Register Assembly="Confirm" Namespace="Confirm" TagPrefix="CC" %>
> <form EnableViewState="true" runat="server">
> <CC:ShowConfirm ID="ShowConfirm1" ConfirmMessage="WANNA EXIT?"
> Text="EXIT" runat="server"/>
> </form>
> Note the
> Output.Write("location.href = window.location.href + '?Proceed=' +
> answer")
> line in the VB class file code. When the ASPX page gets rendered, it
> displays a Button. Conventionally, when a Button is clicked in an ASPX
> page, it posts back to itself using the POST method. When the Button in
> the above custom control is clicked, a JavaScript confirm dialog
> pops-up with 2 buttons - 'OK' & 'Cancel'. If 'OK' is clicked, the value
> of the JavaScript variable 'answer' is true & if 'Cancel' is clicked,
> the value of the variable 'answer' is false.
> What I want is irrespective of whether a user clicks the 'OK' or
> 'Cancel' button in the confirm dialog, instead of posting back to
> itself using the conventional POST method, I want the ASPX page to post
> to itself BUT with a querystring 'Proceed=<value>' appended i.e. I want
> to suppress the conventional post & instead add the querystring so that
> I can find out whether the user has clicked the 'OK' button or the
> 'Cancel' button in the confirm dialog. If the user clicks 'OK', he will
> be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=true
> If the user clicks 'Cancel' in the confirm dialog, he will be taken to
> http://myserver/aspx/Confirm.aspx?Proceed=false
> Can this be done in anyway?

Tuesday, March 13, 2012

Survey dynamic ASP server controls generation plz

How can i add dynamic survey questioners with (Text box, Check box and combo boxs). i am using ASP.NET 2.0,SQL2005.

If you have any good articles are ideas please share.

Thanks in advance

DK

Hi DK,

There are ASP.NET survey/poll controls. You can search them yourself.

http://www.codeproject.com/useritems/Site_Poll_Control.asp

But I'm not sure if it is dynamic.

survey location in mssql server

hi everyone

When I add a Survey the information goes to the database server>table>Lists.

tp_Fields holds the question and the choices
tp_ItemCount gives how many users response to that

but i cant find the field where our selected answer to that survey resides in the database server.

Can any one please tell me to which field or table the User's selected answer goes?

Thanks

anshul

What's the project you're building? Any website refers to the template? Need to look at related code.

Suspect error using RichTextBox Class in server code

Using the 1.1 framework. We are using a newly created instance of a
RichTextBox Class in our server code to manipulate RTF that is stored
in the database. To clarify, we are not using or attempting to use
this class in the aspx page that calls the code, nor is the 'using
System.Windows.Forms' referenced in any of the aspx pages. The first
client using this software has been experiencing an error that we
cannot reproduce in-house. The error occurs intermittently anywhere
after 2-4 days of use, so it is not something reproducible on demand.
The fix is to restart IIS and on a couple of occasions a restart of
the server was necessary. The error is being trapped in code and
returned as string to the user which displays on the aspx page so it
is not an unhandled exception with a dump of the stack trace. The
error message is 'Error creating window handle". Once one user
receives this error all users receive the same error when trying to
perform the same operation. I am not 100% sure that the RichTextBox
code is what is causing the error but based on the message involved it
is my best guess. Here is a code snipit that shows how we are using
the RichTextBox.

string strFreeRTF = drRow["FRTF"].ToString().Trim();
string strTempRTF = drRow["TMPLTRTF"].ToString().Trim();
RichTextBox rtfFree = new RichTextBox();
rtfFree.Rtf = strFreeRTF; //prevents null reference
RichTextBox rtfTemp = new RichTextBox();
rtfTemp.Rtf = strTempRTF;
if(rtfTemp.Text.Length > 0)
{
rtfFree.AppendText("\r\n");
rtfTemp.SelectAll();
rtfTemp.Copy();
rtfFree.Paste();
}
if(strCodedCharting.Length > 0)
{
rtfFree.AppendText("\r\n");
rtfFree.AppendText(strCodedCharting);
}

if(drChart["SUMMARY"].ToString() != "")
{
if(rtfFree.Text.Length > 0)
{
rtfFree.AppendText("\r\n");
}
rtfFree.AppendText(drRow["SMRYTXT"].ToString());
}
if(rtfFree.Text != "")
strRet = rtfFree.Rtf;
return strRet;

The code performs what it is designed to do but obviously we need to
track down why the error occurs.

Does anyone have information that might assist with troubleshooting
this problem. Thanksusing winform controls are not supported by aspx pages. they require a
window handle to perform correctly, and system services like iis and
asp.net, do not have permission to create a window handle as they need
access to the desktop.

you might get away with it if the console is alway logged on the server, and
you gave permission. you still run the risk, that if the control pop's up a
dialog box (say for en error), your asp.net thread will be blocked until
some goes to the console and responds to the dialogbox.

this is very poor design, and you should look at replacing the rtf control
as soon as possible.

-- bruce (sqlwork.com)

"Eric" <msdnsupport@.nospammediserve.com> wrote in message
news:3fc3df27.1150041703@.news.devexpress.com...
> Using the 1.1 framework. We are using a newly created instance of a
> RichTextBox Class in our server code to manipulate RTF that is stored
> in the database. To clarify, we are not using or attempting to use
> this class in the aspx page that calls the code, nor is the 'using
> System.Windows.Forms' referenced in any of the aspx pages. The first
> client using this software has been experiencing an error that we
> cannot reproduce in-house. The error occurs intermittently anywhere
> after 2-4 days of use, so it is not something reproducible on demand.
> The fix is to restart IIS and on a couple of occasions a restart of
> the server was necessary. The error is being trapped in code and
> returned as string to the user which displays on the aspx page so it
> is not an unhandled exception with a dump of the stack trace. The
> error message is 'Error creating window handle". Once one user
> receives this error all users receive the same error when trying to
> perform the same operation. I am not 100% sure that the RichTextBox
> code is what is causing the error but based on the message involved it
> is my best guess. Here is a code snipit that shows how we are using
> the RichTextBox.
>
> string strFreeRTF = drRow["FRTF"].ToString().Trim();
> string strTempRTF = drRow["TMPLTRTF"].ToString().Trim();
> RichTextBox rtfFree = new RichTextBox();
> rtfFree.Rtf = strFreeRTF; //prevents null reference
> RichTextBox rtfTemp = new RichTextBox();
> rtfTemp.Rtf = strTempRTF;
> if(rtfTemp.Text.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> rtfTemp.SelectAll();
> rtfTemp.Copy();
> rtfFree.Paste();
> }
> if(strCodedCharting.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> rtfFree.AppendText(strCodedCharting);
> }
> if(drChart["SUMMARY"].ToString() != "")
> {
> if(rtfFree.Text.Length > 0)
> {
> rtfFree.AppendText("\r\n");
> }
> rtfFree.AppendText(drRow["SMRYTXT"].ToString());
> }
> if(rtfFree.Text != "")
> strRet = rtfFree.Rtf;
> return strRet;
> The code performs what it is designed to do but obviously we need to
> track down why the error occurs.
> Does anyone have information that might assist with troubleshooting
> this problem. Thanks