Thursday, March 29, 2012
Performance Q..
the search text. Is it required to use the text box here, I can use html
input text box and can pass this value for search at the server side when
user clicks the search button.
IS it a good design approach to avoid server side text boxes when compared
to HTML input boxes?
NelsonIt's all a matter of functionality. If all you need is an HTML input form
object, and you don't need it to retain its value across PostBacks,
certainly, a Server Control is not necessary.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
>
Hi Nelson,
I guess you should use the TextBox control. Because, as I know, the normal
requirement for a Search window is to persist the search query after the
page post backs and gets the results. So, if you use html INPUT, you would
have to use another hidden variable to achieve this, with asp.net TextBox
control you would have the ViewState, which does this automatically if you
keep it enabled. If you do not bother about preserviing the search criteria,
go with html INPUT control with runat server
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
>
After the search results (using ZIP Code) I am displaying city, state etc
corresponds to the zip code using a text box control. Is there anyway I can
avoid text box here?
Thanks for your reply.
Nelson
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> It's all a matter of functionality. If all you need is an HTML input form
> object, and you don't need it to retain its value across PostBacks,
> certainly, a Server Control is not necessary.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> get
when
compared
>
1. By making Run at server can I access the search text from the server side
code. Is it correct?
2. In terms of performance does it matter between HTML INPUT control with
runat server attribute and ASP Server side text box.
Thanks for your suggestions.
Nelson.
"Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> Hi Nelson,
> I guess you should use the TextBox control. Because, as I know, the
normal
> requirement for a Search window is to persist the search query after the
> page post backs and gets the results. So, if you use html INPUT, you would
> have to use another hidden variable to achieve this, with asp.net TextBox
> control you would have the ViewState, which does this automatically if you
> keep it enabled. If you do not bother about preserviing the search
criteria,
> go with html INPUT control with runat server
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> get
when
compared
>
I never did performance tests. But, if you set "EnableViewState" to false,
asp.net TextBox is very much same as html INPUT with runat server. Yes by
making runat = server, you could access the text in the server side. Since
this is the only textbox control on your page, you shouldnt be too worried
about performance I guess
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:O2UURsOyEHA.2196@.TK2MSFTNGP14.phx.gbl...
> 1. By making Run at server can I access the search text from the server
side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> normal
would
TextBox
you
> criteria,
to
html
> when
> compared
>
The only performance hit I see is when the asp.net engine converts this
server control into the HTML output for a normal html textbox. Otherwise,
user the textbox control. Nobody will know the difference. The page has to
be compiled either way so its only going to take this hit the first time
"Nelson" wrote:
> 1. By making Run at server can I access the search text from the server si
de
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> normal
> criteria,
> when
> compared
>
>
Hi Nelson,
It all depends on what you want the user to do with the data. If you simply
want to display it, a form input object is not necessary; you can simply
write it out to the page. If, on the other hand, you want the user to be
able to edit it, change, it, etc., you would need a form field. And again,
if you want the values in a form field to survive PostBacks, you need to use
a Server Control. Adding "runat=server" to a Control, and declaring it in
the CodeBehind class, effectively creates a Server Control (an HTMLInputText
Control). You can then manipulate and work with the Control in the
CodeBehind class on the server, and it will retain its value across
PostBacks.
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:uhgKBmOyEHA.924@.TK2MSFTNGP10.phx.gbl...
> After the search results (using ZIP Code) I am displaying city, state etc
> corresponds to the zip code using a text box control. Is there anyway I
can
> avoid text box here?
> Thanks for your reply.
> Nelson
>
> "Kevin Spencer" <kspencer@.takempis.com> wrote in message
> news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
form
to
html
> when
> compared
>
Performance Q..
the search text. Is it required to use the text box here, I can use html
input text box and can pass this value for search at the server side when
user clicks the search button.
IS it a good design approach to avoid server side text boxes when compared
to HTML input boxes?
NelsonIt's all a matter of functionality. If all you need is an HTML input form
object, and you don't need it to retain its value across PostBacks,
certainly, a Server Control is not necessary.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
Hi Nelson,
I guess you should use the TextBox control. Because, as I know, the normal
requirement for a Search window is to persist the search query after the
page post backs and gets the results. So, if you use html INPUT, you would
have to use another hidden variable to achieve this, with asp.net TextBox
control you would have the ViewState, which does this automatically if you
keep it enabled. If you do not bother about preserviing the search criteria,
go with html INPUT control with runat server
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> In one of the search window (zip code search) I am using ASP Text box to
get
> the search text. Is it required to use the text box here, I can use html
> input text box and can pass this value for search at the server side when
> user clicks the search button.
> IS it a good design approach to avoid server side text boxes when compared
> to HTML input boxes?
> Nelson
After the search results (using ZIP Code) I am displaying city, state etc
corresponds to the zip code using a text box control. Is there anyway I can
avoid text box here?
Thanks for your reply.
Nelson
"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> It's all a matter of functionality. If all you need is an HTML input form
> object, and you don't need it to retain its value across PostBacks,
> certainly, a Server Control is not necessary.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
1. By making Run at server can I access the search text from the server side
code. Is it correct?
2. In terms of performance does it matter between HTML INPUT control with
runat server attribute and ASP Server side text box.
Thanks for your suggestions.
Nelson.
"Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> Hi Nelson,
> I guess you should use the TextBox control. Because, as I know, the
normal
> requirement for a Search window is to persist the search query after the
> page post backs and gets the results. So, if you use html INPUT, you would
> have to use another hidden variable to achieve this, with asp.net TextBox
> control you would have the ViewState, which does this automatically if you
> keep it enabled. If you do not bother about preserviing the search
criteria,
> go with html INPUT control with runat server
> "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > In one of the search window (zip code search) I am using ASP Text box to
> get
> > the search text. Is it required to use the text box here, I can use html
> > input text box and can pass this value for search at the server side
when
> > user clicks the search button.
> > IS it a good design approach to avoid server side text boxes when
compared
> > to HTML input boxes?
> > Nelson
I never did performance tests. But, if you set "EnableViewState" to false,
asp.net TextBox is very much same as html INPUT with runat server. Yes by
making runat = server, you could access the text in the server side. Since
this is the only textbox control on your page, you shouldnt be too worried
about performance I guess
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:O2UURsOyEHA.2196@.TK2MSFTNGP14.phx.gbl...
> 1. By making Run at server can I access the search text from the server
side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you
would
> > have to use another hidden variable to achieve this, with asp.net
TextBox
> > control you would have the ViewState, which does this automatically if
you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >
The only performance hit I see is when the asp.net engine converts this
server control into the HTML output for a normal html textbox. Otherwise,
user the textbox control. Nobody will know the difference. The page has to
be compiled either way so its only going to take this hit the first time
"Nelson" wrote:
> 1. By making Run at server can I access the search text from the server side
> code. Is it correct?
> 2. In terms of performance does it matter between HTML INPUT control with
> runat server attribute and ASP Server side text box.
> Thanks for your suggestions.
> Nelson.
>
>
> "Kumar Reddi" <KumarReddi@.REMOVETHIS.gmail.com> wrote in message
> news:OGm3EgOyEHA.3024@.TK2MSFTNGP14.phx.gbl...
> > Hi Nelson,
> > I guess you should use the TextBox control. Because, as I know, the
> normal
> > requirement for a Search window is to persist the search query after the
> > page post backs and gets the results. So, if you use html INPUT, you would
> > have to use another hidden variable to achieve this, with asp.net TextBox
> > control you would have the ViewState, which does this automatically if you
> > keep it enabled. If you do not bother about preserviing the search
> criteria,
> > go with html INPUT control with runat server
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box to
> > get
> > > the search text. Is it required to use the text box here, I can use html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> > >
Hi Nelson,
It all depends on what you want the user to do with the data. If you simply
want to display it, a form input object is not necessary; you can simply
write it out to the page. If, on the other hand, you want the user to be
able to edit it, change, it, etc., you would need a form field. And again,
if you want the values in a form field to survive PostBacks, you need to use
a Server Control. Adding "runat=server" to a Control, and declaring it in
the CodeBehind class, effectively creates a Server Control (an HTMLInputText
Control). You can then manipulate and work with the Control in the
CodeBehind class on the server, and it will retain its value across
PostBacks.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
news:uhgKBmOyEHA.924@.TK2MSFTNGP10.phx.gbl...
> After the search results (using ZIP Code) I am displaying city, state etc
> corresponds to the zip code using a text box control. Is there anyway I
can
> avoid text box here?
> Thanks for your reply.
> Nelson
>
> "Kevin Spencer" <kspencer@.takempis.com> wrote in message
> news:e1CrReOyEHA.2752@.TK2MSFTNGP11.phx.gbl...
> > It's all a matter of functionality. If all you need is an HTML input
form
> > object, and you don't need it to retain its value across PostBacks,
> > certainly, a Server Control is not necessary.
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Neither a follower
> > nor a lender be.
> > "Nelson" <NelsonSmith1997@.hotmail.com> wrote in message
> > news:ezSB$aOyEHA.260@.TK2MSFTNGP11.phx.gbl...
> > > In one of the search window (zip code search) I am using ASP Text box
to
> > get
> > > the search text. Is it required to use the text box here, I can use
html
> > > input text box and can pass this value for search at the server side
> when
> > > user clicks the search button.
> > > > IS it a good design approach to avoid server side text boxes when
> compared
> > > to HTML input boxes?
> > > > Nelson
> >
Monday, March 26, 2012
Performing a download along with another action
1. Delete a record from a database
2. Let the user download a text file that is generated
3. Refresh the page to show that the record was deleted
I am able to do any of these things separately with no trouble. The problem
occurs when I try to offer a download AND call my refresh method. When I try
to do a download and call my refresh method, only the download is performed,
regardless of whether the refresh is called before or after the download.
Here is snippet of my code that does the download and refresh:
Me.RefreshEvents()
Response.ClearContent()
Response.ContentType = "text/plain"
Response.AddHeader("content-disposition", "attachment;filename=" &
downloadname)
Response.Write(downloadtext)
Response.End()
If I comment out five lines that do the download, Me.RefreshEvents() does
what I want and would expect, but otherwise it appears to do nothing. I
don't care whether Me.RefreshEvents() is called before or after doing the
download, as long as they are both done. What can I do to make sure both of
these tasks get completed?
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/when the browser requests a page (like when the user hit the button), the
browser only expects one document back. you can do one of several options
1) refesh page and enable a download button
2) refresh page and use client script to start a download
3) refresh page and use meta tag to start download
in all cases you refresh the page and then download the text file.
-- bruce (sqlwork.com)
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
This can be done. What is meant by refreshing the page, something like
re-display the grid?
So the user hits the button:
1. You delete the record and re-bind the grid so the user can see the
changes on this page.
2. You save the text to be downloaded in a session variable - this is the
simplest, or on disk, or database record, etc.
3. You have a Protected string variable, say MustDownLoad, and set it's
value "Yes", or anything, to be read by Java script.
4. In the HTML view of the form, right at the bottom, you must add Java
script to open a new window to download the text:
<script language="javascript">
if ("<%=MustDownLoad%>" != "") {
window.open("Form_DownLoadText.aspx");
}
</script>
5. You create a new form Form_DownLoadText.aspx and in it, you read the text
from the session variable/disk/record and do the
Response.ClearContent()
Response.ContentType = "text/plain"
yada yada
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
Nathan,
Maybe a stupid question, why do you not use the HTML command File Field. It
is a strange name because AFAIK mostly is used Download Button.
It is the HTML tag <Input type=file
Cor
Performing a download along with another action
1. Delete a record from a database
2. Let the user download a text file that is generated
3. Refresh the page to show that the record was deleted
I am able to do any of these things separately with no trouble. The problem
occurs when I try to offer a download AND call my refresh method. When I try
to do a download and call my refresh method, only the download is performed,
regardless of whether the refresh is called before or after the download.
Here is snippet of my code that does the download and refresh:
Me.RefreshEvents()
Response.ClearContent()
Response.ContentType = "text/plain"
Response.AddHeader("content-disposition", "attachment;filename=" &
downloadname)
Response.Write(downloadtext)
Response.End()
If I comment out five lines that do the download, Me.RefreshEvents() does
what I want and would expect, but otherwise it appears to do nothing. I
don't care whether Me.RefreshEvents() is called before or after doing the
download, as long as they are both done. What can I do to make sure both of
these tasks get completed?
--
Nathan Sokalski
njsokalski@dotnet.itags.org.hotmail.com
http://www.nathansokalski.com/when the browser requests a page (like when the user hit the button), the
browser only expects one document back. you can do one of several options
1) refesh page and enable a download button
2) refresh page and use client script to start a download
3) refresh page and use meta tag to start download
in all cases you refresh the page and then download the text file.
-- bruce (sqlwork.com)
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
This can be done. What is meant by refreshing the page, something like
re-display the grid?
So the user hits the button:
1. You delete the record and re-bind the grid so the user can see the
changes on this page.
2. You save the text to be downloaded in a session variable - this is the
simplest, or on disk, or database record, etc.
3. You have a Protected string variable, say MustDownLoad, and set it's
value "Yes", or anything, to be read by Java script.
4. In the HTML view of the form, right at the bottom, you must add Java
script to open a new window to download the text:
<script language="javascript">
if ("<%=MustDownLoad%>" != "") {
window.open("Form_DownLoadText.aspx");
}
</script>
5. You create a new form Form_DownLoadText.aspx and in it, you read the text
from the session variable/disk/record and do the
Response.ClearContent()
Response.ContentType = "text/plain"
yada yada
"Nathan Sokalski" <njsokalski@.hotmail.com> wrote in message
news:OluwItk6FHA.2176@.TK2MSFTNGP14.phx.gbl...
>I have a webform that contains a button which I want to do three things:
> 1. Delete a record from a database
> 2. Let the user download a text file that is generated
> 3. Refresh the page to show that the record was deleted
> I am able to do any of these things separately with no trouble. The
> problem occurs when I try to offer a download AND call my refresh method.
> When I try to do a download and call my refresh method, only the download
> is performed, regardless of whether the refresh is called before or after
> the download. Here is snippet of my code that does the download and
> refresh:
>
> Me.RefreshEvents()
> Response.ClearContent()
> Response.ContentType = "text/plain"
> Response.AddHeader("content-disposition", "attachment;filename=" &
> downloadname)
> Response.Write(downloadtext)
> Response.End()
>
> If I comment out five lines that do the download, Me.RefreshEvents() does
> what I want and would expect, but otherwise it appears to do nothing. I
> don't care whether Me.RefreshEvents() is called before or after doing the
> download, as long as they are both done. What can I do to make sure both
> of these tasks get completed?
> --
> Nathan Sokalski
> njsokalski@.hotmail.com
> http://www.nathansokalski.com/
>
Nathan,
Maybe a stupid question, why do you not use the HTML command File Field. It
is a strange name because AFAIK mostly is used Download Button.
It is the HTML tag <Input type=file>
Cor
performing error check on date values entered in a textbox
Use the compareValidator, and set the Type to Date (making sure you also set the 'Control to Validate' property).
If you really really really want to do it in code (which is not advisable, but I have had to do it once or twice), then here is a little function I got from somebody:
Public Function IsDateValid(ByVal strDate As String) As Boolean
Try
' attempt parse
Dim dtParsed As DateTime = DateTime.Parse(strDate)
Return True
Catch ' parse failed
End Try
Return False
End Function
IsDateValid("200323") returns false
IsDateValid("20/12/2004") returns true
Not sure if it will work with yyyy-mm-dd, but try and and let us know.
HTH
Jagdip
perhaps a simple question
i have a problem.
I have a textbox and a button and a link in my application. When the user clicks the button, the text of the textbox is inserted in my table northwind.
After this is done succesful i want to display a messagebox. After searching in the groups i did this.
Button1_Click(......)
{
--entry in northwind--
string alertscript= "<script language= JavaScript>alert('Succefull inserted');</script>";
if(!IsClientScriptBlockRegistered("alert"))
{
this.RegisterClientScriptBlock("alert", alertscript);
}
}
It works good. But when i click now on the link to another page and then after that click the backbutton in the IE6 to my first page, then the messageBox pops up again. I don`t know why this is done. Is the script still registered ? Please help me? I need to stop this.
Thankswhen you hit your back button, your going back to a cached copy of the page which still has the script in it.
personally, i wouldnt use an alert. Id put a Label/Literal control on the page and then upon successfully inserting a db record, you can set the Text of that control and make it visible.
When the user hits their back button, they still see the old message, but it's not in the way...
Permission
I've created my SmartClient that have to print some text directly to the
printer. To do it, I create a text file and after copy it to the printer.
Perfect... But, I am having some permission problems... Look the error:
The application tried to execute a not permited operation by the security
directive ...
System.Drawing.PrintingPermission, System.Drawing.Version=...
Could someone help me?
Thank'sHi,
I think i already send you chris sells article. you can find your
solution there :
http://msdn.microsoft.com/library/d...y/en-us/dnforms
/html/winforms11122002.asp
and
http://msdn.microsoft.com/msdnmag/i...etSmartClients/
HTH
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
Permission
I've created my SmartClient that have to print some text directly to the
printer. To do it, I create a text file and after copy it to the printer.
Perfect... But, I am having some permission problems... Look the error:
The application tried to execute a not permited operation by the security
directive ...
System.Drawing.PrintingPermission, System.Drawing.Version=...
Could someone help me?
Thank'sHi,
I think i already send you chris sells article. you can find your
solution there :
http://msdn.microsoft.com/library/d...y/en-us/dnforms
/html/winforms11122002.asp
and
http://msdn.microsoft.com/msdnmag/i...etSmartClients/
HTH
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Saturday, March 24, 2012
permission denied error message
We have a webservice that can log information to a text file on the local
machine. The ability to log information is configurable. The .net web service
is called from a vb dll. From the vb side of the fence, we're getting an
error message that indicates access is denied to the log file. The folder and
log file both have the asnet user set up with full control. Additionally the
parent folders have list access and read access for the user. The security
event log contains a record with the permissions being requested.
Additional info: the web service works on two other boxes with simular
configurations. The major difference is the box that doesn't work is in the
DMZ and does not have a domain controller.
Any ideas?
KenHi Ken,
In your webservice, do you allow or deny anonymous access?
if you don't deny anonymous access, you might need to
grant permossion to another account IUSR (Ineternet Guest
Account).
HTH
Elton Wang
elton_wang@.hotmail.com
>--Original Message--
>Hi,
>We have a webservice that can log information to a text
file on the local
>machine. The ability to log information is configurable.
The .net web service
>is called from a vb dll. From the vb side of the fence,
we're getting an
>error message that indicates access is denied to the log
file. The folder and
>log file both have the asnet user set up with full
control. Additionally the
>parent folders have list access and read access for the
user. The security
>event log contains a record with the permissions being
requested.
>Additional info: the web service works on two other boxes
with simular
>configurations. The major difference is the box that
doesn't work is in the
>DMZ and does not have a domain controller.
>Any ideas?
>Ken
>.
Wednesday, March 21, 2012
Permissions Problem
from one web server to another.
Here is the situation:
We have two domains in place one is Active Directory and the other is an old
NT4 domain. These two domains have a trust between them.
On a 2003 server I am using the file system object to write a text file to a
NT4 web server. The folder on the NT 4 server currently is shared with open
security with control for everyone on Domain1 and Domain2. The 2003 server's
worker process is running under a domain account that has full access to the
folder.
I am able to map a drive to the share from the 2003 box to the NT4 box while
logged in with an admin account of the 2003 box. I am also able to run a
.vbs script on the 2003 box that is able to place a text file on the NT4
box. Of course, I do believe that script runs and creates the file system
object as the logged in user of the 2003 box.
Now to the non-working part. On my asp.net and classic asp page I am unable
to write a text file from the 2003 box to the NT4 box at all. The virtual
server(s) that are serving the pages have anon security turned on and use
the IUSR_MachineName account. Since I have every permission imaginable added
to the folder on the NT4 box for both domains at full control. My theory is
that possibly the IUSR account is the account that is actually creating the
object and trying to place the text file. I only theorize this because I can
not place the text file and that account seems to be the only one w/o
permissions to that folder since it is a local machine account and not a
domain account.
So my real question here is if my theory is right and/or what exactly is
going on here. After spending much too long on this problem and feeling like
a noob I am at a loss as to what to try next. Any suggestion would be
greatly appreciated.
Thank you)The crux of this is that the user under which you try to access the remote
dir must be the same user that your script is running as. This become a
real pain when you tie this in with permissions across domains. So, on your
win3k box you need to impersonate in asp.net the user with permissions and
allow asp.net to run on behlaf of that trusted user. I've not tried it
between trusted domains, but it will be a pain I expect.
Why dont you cut your losses and pass the text as a post request to your NT4
web server and have asp create the file for you on the NT 4 box.
Regards
John Timney
Microsoft Regional Director
Microsoft MVP
"Brian Cooper" <cooperb@.ingrambarge.com> wrote in message
news:QtCFc.3796$XF5.2833@.bignews4.bellsouth.net...
> I am trying to determine a permission problem trying to write a text file
> from one web server to another.
> Here is the situation:
> We have two domains in place one is Active Directory and the other is an
old
> NT4 domain. These two domains have a trust between them.
> On a 2003 server I am using the file system object to write a text file to
a
> NT4 web server. The folder on the NT 4 server currently is shared with
open
> security with control for everyone on Domain1 and Domain2. The 2003
server's
> worker process is running under a domain account that has full access to
the
> folder.
> I am able to map a drive to the share from the 2003 box to the NT4 box
while
> logged in with an admin account of the 2003 box. I am also able to run a
> .vbs script on the 2003 box that is able to place a text file on the NT4
> box. Of course, I do believe that script runs and creates the file system
> object as the logged in user of the 2003 box.
> Now to the non-working part. On my asp.net and classic asp page I am
unable
> to write a text file from the 2003 box to the NT4 box at all. The virtual
> server(s) that are serving the pages have anon security turned on and use
> the IUSR_MachineName account. Since I have every permission imaginable
added
> to the folder on the NT4 box for both domains at full control. My theory
is
> that possibly the IUSR account is the account that is actually creating
the
> object and trying to place the text file. I only theorize this because I
can
> not place the text file and that account seems to be the only one w/o
> permissions to that folder since it is a local machine account and not a
> domain account.
> So my real question here is if my theory is right and/or what exactly is
> going on here. After spending much too long on this problem and feeling
like
> a noob I am at a loss as to what to try next. Any suggestion would be
> greatly appreciated.
> Thank you)
>
Hi,
ASP.NET by default does not impersonate the logged on user, but rather runs
under the local ASPNET account, which is a least privliedged account. In ord
er to have the ASP.NET application impersonate the original caller you must
set imperonsation to true,
and authorization mode to Windows in your Web.Config. You also have to set W
indows Integrated Security in IIS. After this is done, if the logged on use
has access to the shared folder, there should be no problem accessing it.
Another thing also, is that you mentioned you are using the File System Obje
ct in Classic asp to access the share. If this is the case, then this object
does not understand UNC paths within a web application, this may be your pr
oblem. Try using another ob
ject if possible.
hope this helps,
sivilian
"Brian Cooper" wrote:
> I am trying to determine a permission problem trying to write a text file
> from one web server to another.
> Here is the situation:
> We have two domains in place one is Active Directory and the other is an o
ld
> NT4 domain. These two domains have a trust between them.
> On a 2003 server I am using the file system object to write a text file to
a
> NT4 web server. The folder on the NT 4 server currently is shared with ope
n
> security with control for everyone on Domain1 and Domain2. The 2003 server
's
> worker process is running under a domain account that has full access to t
he
> folder.
> I am able to map a drive to the share from the 2003 box to the NT4 box whi
le
> logged in with an admin account of the 2003 box. I am also able to run a
> ..vbs script on the 2003 box that is able to place a text file on the NT4
> box. Of course, I do believe that script runs and creates the file system
> object as the logged in user of the 2003 box.
> Now to the non-working part. On my asp.net and classic asp page I am unabl
e
> to write a text file from the 2003 box to the NT4 box at all. The virtual
> server(s) that are serving the pages have anon security turned on and use
> the IUSR_MachineName account. Since I have every permission imaginable add
ed
> to the folder on the NT4 box for both domains at full control. My theory i
s
> that possibly the IUSR account is the account that is actually creating th
e
> object and trying to place the text file. I only theorize this because I c
an
> not place the text file and that account seems to be the only one w/o
> permissions to that folder since it is a local machine account and not a
> domain account.
> So my real question here is if my theory is right and/or what exactly is
> going on here. After spending much too long on this problem and feeling li
ke
> a noob I am at a loss as to what to try next. Any suggestion would be
> greatly appreciated.
> Thank you)
>
>
Permissions Problem
from one web server to another.
Here is the situation:
We have two domains in place one is Active Directory and the other is an old
NT4 domain. These two domains have a trust between them.
On a 2003 server I am using the file system object to write a text file to a
NT4 web server. The folder on the NT 4 server currently is shared with open
security with control for everyone on Domain1 and Domain2. The 2003 server's
worker process is running under a domain account that has full access to the
folder.
I am able to map a drive to the share from the 2003 box to the NT4 box while
logged in with an admin account of the 2003 box. I am also able to run a
..vbs script on the 2003 box that is able to place a text file on the NT4
box. Of course, I do believe that script runs and creates the file system
object as the logged in user of the 2003 box.
Now to the non-working part. On my asp.net and classic asp page I am unable
to write a text file from the 2003 box to the NT4 box at all. The virtual
server(s) that are serving the pages have anon security turned on and use
the IUSR_MachineName account. Since I have every permission imaginable added
to the folder on the NT4 box for both domains at full control. My theory is
that possibly the IUSR account is the account that is actually creating the
object and trying to place the text file. I only theorize this because I can
not place the text file and that account seems to be the only one w/o
permissions to that folder since it is a local machine account and not a
domain account.
So my real question here is if my theory is right and/or what exactly is
going on here. After spending much too long on this problem and feeling like
a noob I am at a loss as to what to try next. Any suggestion would be
greatly appreciated.
Thank you)The crux of this is that the user under which you try to access the remote
dir must be the same user that your script is running as. This become a
real pain when you tie this in with permissions across domains. So, on your
win3k box you need to impersonate in asp.net the user with permissions and
allow asp.net to run on behlaf of that trusted user. I've not tried it
between trusted domains, but it will be a pain I expect.
Why dont you cut your losses and pass the text as a post request to your NT4
web server and have asp create the file for you on the NT 4 box.
--
Regards
John Timney
Microsoft Regional Director
Microsoft MVP
"Brian Cooper" <cooperb@.ingrambarge.com> wrote in message
news:QtCFc.3796$XF5.2833@.bignews4.bellsouth.net...
> I am trying to determine a permission problem trying to write a text file
> from one web server to another.
> Here is the situation:
> We have two domains in place one is Active Directory and the other is an
old
> NT4 domain. These two domains have a trust between them.
> On a 2003 server I am using the file system object to write a text file to
a
> NT4 web server. The folder on the NT 4 server currently is shared with
open
> security with control for everyone on Domain1 and Domain2. The 2003
server's
> worker process is running under a domain account that has full access to
the
> folder.
> I am able to map a drive to the share from the 2003 box to the NT4 box
while
> logged in with an admin account of the 2003 box. I am also able to run a
> .vbs script on the 2003 box that is able to place a text file on the NT4
> box. Of course, I do believe that script runs and creates the file system
> object as the logged in user of the 2003 box.
> Now to the non-working part. On my asp.net and classic asp page I am
unable
> to write a text file from the 2003 box to the NT4 box at all. The virtual
> server(s) that are serving the pages have anon security turned on and use
> the IUSR_MachineName account. Since I have every permission imaginable
added
> to the folder on the NT4 box for both domains at full control. My theory
is
> that possibly the IUSR account is the account that is actually creating
the
> object and trying to place the text file. I only theorize this because I
can
> not place the text file and that account seems to be the only one w/o
> permissions to that folder since it is a local machine account and not a
> domain account.
> So my real question here is if my theory is right and/or what exactly is
> going on here. After spending much too long on this problem and feeling
like
> a noob I am at a loss as to what to try next. Any suggestion would be
> greatly appreciated.
> Thank you)
Hi,
ASP.NET by default does not impersonate the logged on user, but rather runs under the local ASPNET account, which is a least privliedged account. In order to have the ASP.NET application impersonate the original caller you must set imperonsation to true, and authorization mode to Windows in your Web.Config. You also have to set Windows Integrated Security in IIS. After this is done, if the logged on use has access to the shared folder, there should be no problem accessing it.
Another thing also, is that you mentioned you are using the File System Object in Classic asp to access the share. If this is the case, then this object does not understand UNC paths within a web application, this may be your problem. Try using another object if possible.
hope this helps,
sivilian
"Brian Cooper" wrote:
> I am trying to determine a permission problem trying to write a text file
> from one web server to another.
> Here is the situation:
> We have two domains in place one is Active Directory and the other is an old
> NT4 domain. These two domains have a trust between them.
> On a 2003 server I am using the file system object to write a text file to a
> NT4 web server. The folder on the NT 4 server currently is shared with open
> security with control for everyone on Domain1 and Domain2. The 2003 server's
> worker process is running under a domain account that has full access to the
> folder.
> I am able to map a drive to the share from the 2003 box to the NT4 box while
> logged in with an admin account of the 2003 box. I am also able to run a
> ..vbs script on the 2003 box that is able to place a text file on the NT4
> box. Of course, I do believe that script runs and creates the file system
> object as the logged in user of the 2003 box.
> Now to the non-working part. On my asp.net and classic asp page I am unable
> to write a text file from the 2003 box to the NT4 box at all. The virtual
> server(s) that are serving the pages have anon security turned on and use
> the IUSR_MachineName account. Since I have every permission imaginable added
> to the folder on the NT4 box for both domains at full control. My theory is
> that possibly the IUSR account is the account that is actually creating the
> object and trying to place the text file. I only theorize this because I can
> not place the text file and that account seems to be the only one w/o
> permissions to that folder since it is a local machine account and not a
> domain account.
> So my real question here is if my theory is right and/or what exactly is
> going on here. After spending much too long on this problem and feeling like
> a noob I am at a loss as to what to try next. Any suggestion would be
> greatly appreciated.
> Thank you)
>
Perserving characters in Session object
I am having a problem storing Irish text in a session object - Irish text
has some symbols ( for example) that are being lost when I retrieve the
text from the session.
Any ideas how I can deal with this - the characters are being displayed
correctly on the page itself if they come from the database or any other
source rather than the session object.
JoeAcutally after a bit of further investigation I discovered that by default
asp.net uses UTF-8 (unicode) for everything which would accommodate these
characters. What was happening in my case was that I was using the thycotic
remote scripting component to do some server updates and to send such
characters to the server requires that you urlencode them first as that
component seems to rely on a hidden frame in the page to call the remote
script.
"Joe Molloy" <molloy_joe@.hotmail.com> wrote in message
news:OcCcchFxFHA.2960@.tk2msftngp13.phx.gbl...
> Hi,
> I am having a problem storing Irish text in a session object - Irish text
> has some symbols ( for example) that are being lost when I retrieve the
> text from the session.
> Any ideas how I can deal with this - the characters are being displayed
> correctly on the page itself if they come from the database or any other
> source rather than the session object.
>
> Joe
Perserving characters in Session object
I am having a problem storing Irish text in a session object - Irish text
has some symbols ( for example) that are being lost when I retrieve the
text from the session.
Any ideas how I can deal with this - the characters are being displayed
correctly on the page itself if they come from the database or any other
source rather than the session object.
JoeAcutally after a bit of further investigation I discovered that by default
asp.net uses UTF-8 (unicode) for everything which would accommodate these
characters. What was happening in my case was that I was using the thycotic
remote scripting component to do some server updates and to send such
characters to the server requires that you urlencode them first as that
component seems to rely on a hidden frame in the page to call the remote
script.
"Joe Molloy" <molloy_joe@.hotmail.com> wrote in message
news:OcCcchFxFHA.2960@.tk2msftngp13.phx.gbl...
> Hi,
> I am having a problem storing Irish text in a session object - Irish text
> has some symbols ( for example) that are being lost when I retrieve the
> text from the session.
> Any ideas how I can deal with this - the characters are being displayed
> correctly on the page itself if they come from the database or any other
> source rather than the session object.
>
> Joe
>