Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Saturday, March 31, 2012

Theming custom created WebParts in ASP.NET 2.0

I have created my own WebPart using code, it is not derived from a UserControl.
Inside this WebPart I create a Calendar Control and add it to the WebParts
Control collection.

Now I want to apply a theme to this Calendar that is inside my WebPart. How
do I do that? I have created a theme and added a definition for a calendar.
The theme is applied to a calendar that is not inside the WebPart, but it is
not applied to the one inside.Hi c_kimbell,

Welcome to MSDN newsgroup.
As for the custom WebPart with a Calendar inside it, is it possible that we
define a public property on the Custom webPart which represent the Theme of
the inside Calendar control? Then, we any one assign a new value for this
property, the nested calendar's Theme value will be changed accordingly.

In addition, for .NET 2.0 and VS.NET whidbey beta issues, I suggest you
also try posting in the following web forum:

http://forums.microsoft.com/msdn/

since there are some other experienced members who may have some good ideas.

Thank you,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Thanks for suggesting the ASP.NET forums, I have posted there now as well.

Here are some more details on what I have tried;
1. On the webpart I have exposed the Calendar as a property with the name
FromCalendar.
2. I have added the following to the .skin file

<%@. Register Assembly="IMK.WebParts" Namespace="IMK.WebParts"
TagPrefix="IMK" %
<IMK:IMKDateWebPart runat="server">
<FromCalendar BackColor="#FFFFCC">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</FromCalendar>
</IMK:IMKDateWebPart
Am I on the right track?

"Steven Cheng[MSFT]" wrote:

> Hi c_kimbell,
> Welcome to MSDN newsgroup.
> As for the custom WebPart with a Calendar inside it, is it possible that we
> define a public property on the Custom webPart which represent the Theme of
> the inside Calendar control? Then, we any one assign a new value for this
> property, the nested calendar's Theme value will be changed accordingly.
> In addition, for .NET 2.0 and VS.NET whidbey beta issues, I suggest you
> also try posting in the following web forum:
> http://forums.microsoft.com/msdn/
> since there are some other experienced members who may have some good ideas.
> Thank you,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Hi c_kimbell,

Thanks for your followup.
As you mentioned that
=================

1. On the webpart I have exposed the Calendar as a property with the name
FromCalendar.
2. I have added the following to the .skin file

<%@. Register Assembly="IMK.WebParts" Namespace="IMK.WebParts"
TagPrefix="IMK" %
<IMK:IMKDateWebPart runat="server">
<FromCalendar BackColor="#FFFFCC">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</FromCalendar>
</IMK:IMKDateWebPart>
=======================

I'm not sure whether this will cause error since I haven't tested it.
However, IMO, I'd prefer expose a single string property on my custom web
control which represent the nested child calendar's Theme(or
stylesheettheme). Since the ASP.NET 2.0 's Theme are mostly for those
simple type properteis (such as string, int), I think just exposing a
single string type property will be much better). You can do the actual
Theme adjusting in the Property's Setter method.
How do you think ?

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
I get your point about using simple strings. One thing though, say you expose
a color, this can be specified using a name like 'Red' or it may be specified
using hex notation, like '#FFCC66'. The controls require a Color object, how
does one map between the different representations and the Color object. Are
there any utility classes I can use?

I have now done a bit more experimenting. If I declaratively add the webpart
to a webpartzone, then the theme is correctly applied. If I add the same
webpart to the zone using a catalog, the style is not applied. The catalog
I'm adding from is a custom created one, not one of the predefined types.

Any suggestions?

"Steven Cheng[MSFT]" wrote:

> Hi c_kimbell,
> Thanks for your followup.
> As you mentioned that
> =================
>
> 1. On the webpart I have exposed the Calendar as a property with the name
> FromCalendar.
> 2. I have added the following to the .skin file
> <%@. Register Assembly="IMK.WebParts" Namespace="IMK.WebParts"
> TagPrefix="IMK" %>
> <IMK:IMKDateWebPart runat="server">
> <FromCalendar BackColor="#FFFFCC">
> <SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
> <TitleStyle BackColor="#990000" Font-Bold="True" Font-Size="9pt"
> ForeColor="#FFFFCC" />
> </FromCalendar>
> </IMK:IMKDateWebPart>
> =======================
> I'm not sure whether this will cause error since I haven't tested it.
> However, IMO, I'd prefer expose a single string property on my custom web
> control which represent the nested child calendar's Theme(or
> stylesheettheme). Since the ASP.NET 2.0 's Theme are mostly for those
> simple type properteis (such as string, int), I think just exposing a
> single string type property will be much better). You can do the actual
> Theme adjusting in the Property's Setter method.
> How do you think ?
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Hi c_kimbell,

For those Color field, the ASP.NET runtime's ControlParser will help parse
the property value into the correct object instance. And for Color, there
is the ColorTranslator class which can be used from convert string color
value to System.Drawing.Color instance. For example:

string htmlColor = "Blue";
//or string htmlColor = "#3344ee";
// Translate htmlColor to a GDI+ Color structure.
Color myColor = ColorTranslator.FromHtml(htmlColor);

For the applying theme for custom created catalog's webpart, I'm not sure
whether this is ok. As far as I know, since the ASP.NET2.0 runtime apply
theme for controls in the page's PreInit event, so any change on Theme
after that event (for example in Page_load ..., post back event) will not
work in the first loading...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

There is a bug concerning SSL and ASP.Net 2.0 Menu Control

Hi all

It appears there is a bug - when using a 2 or more tier menu control in
asp.net in an SSL environment you get prompted with the:

"This page contains both secure and non-secure items blah blah"

a) has anyone else experienced?

b) if so do we know when to expect it to be fixed?

Thanks
KevMantorok wrote:
> Hi all
> It appears there is a bug - when using a 2 or more tier menu control in
> asp.net in an SSL environment you get prompted with the:
> "This page contains both secure and non-secure items blah blah"

Have you looked at the generated HTML to see if there is a mistake that
you made? I haven't used this control in an SSL environment yet so I'm
only speculating.

Good luck,

--
Sean
"Fao, Sean" <enceladus311@.yahoo.comI-WANT-NO-SPAM> wrote in message
news:ubV70OfFGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Mantorok wrote:
>> Hi all
>>
>> It appears there is a bug - when using a 2 or more tier menu control in
>> asp.net in an SSL environment you get prompted with the:
>>
>> "This page contains both secure and non-secure items blah blah"
> Have you looked at the generated HTML to see if there is a mistake that
> you made? I haven't used this control in an SSL environment yet so I'm
> only speculating.

Yep I've checked, I've used relative paths in my links.

Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0h62$nmc$1@.newsfeed.th.ifl.net...

> Yep I've checked, I've used relative paths in my links.

Do any of the links point to resources in non-SSL locations? If so, you will
get the message box by default when you access an SSL page which contains
links to non-SSL resources.
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:Oub62lfFGHA.1676@.TK2MSFTNGP09.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0h62$nmc$1@.newsfeed.th.ifl.net...
>> Yep I've checked, I've used relative paths in my links.
> Do any of the links point to resources in non-SSL locations? If so, you
> will get the message box by default when you access an SSL page which
> contains links to non-SSL resources.

Yes there are links in the master page that link back to non-secure sites -
does that really make a difference? Sounds odd if it does.

Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0lgl$q9r$1@.newsfeed.th.ifl.net...

> Yes there are links in the master page that link back to non-secure
> sites -

There's your problem...

> does that really make a difference?

Yes.

> Sounds odd if it does.

Perfectly logical if you think about it...
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:eGZYZCgFGHA.1676@.TK2MSFTNGP09.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0lgl$q9r$1@.newsfeed.th.ifl.net...
>> Yes there are links in the master page that link back to non-secure
>> sites -
> There's your problem...
>> does that really make a difference?
> Yes.
>> Sounds odd if it does.
> Perfectly logical if you think about it...

Wait a minute - do you mean hyperlinks or just linking to non-secure stuff,
if you mean the latter then no, but the former - yes.

Kev
most likely you are referencing an image over http. the easiest way to find
the reference is to use firefox, and goto to the media tab on the pageinfo,
you will see the http reference.

-- bruce (sqlwork.com)

"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0gjm$nbo$1@.newsfeed.th.ifl.net...
> Hi all
> It appears there is a bug - when using a 2 or more tier menu control in
> asp.net in an SSL environment you get prompted with the:
> "This page contains both secure and non-secure items blah blah"
> a) has anyone else experienced?
> b) if so do we know when to expect it to be fixed?
> Thanks
> Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0nd6$rbg$1@.newsfeed.th.ifl.net...

> Wait a minute - do you mean hyperlinks or just linking to non-secure
> stuff, if you mean the latter then no, but the former - yes.

Either; both; whatever - that's the way it is...
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:eQVWamnFGHA.3064@.TK2MSFTNGP10.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0nd6$rbg$1@.newsfeed.th.ifl.net...
>> Wait a minute - do you mean hyperlinks or just linking to non-secure
>> stuff, if you mean the latter then no, but the former - yes.
> Either; both; whatever - that's the way it is...

I don't think so - a hyperlink on a SSL site pointing to HTTP is not classed
as containing a non-secure item.

Firefox doesn't seem to give me this message, only IE...

Kev
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:ORHYzZiFGHA.2444@.TK2MSFTNGP11.phx.gbl...
> most likely you are referencing an image over http. the easiest way to
> find the reference is to use firefox, and goto to the media tab on the
> pageinfo, you will see the http reference.

Nope - all HTTPS - also, Firefox doesn't give me this shit - only IE
does...

Kev
Hi

Any references to non-SSL pages - including the code which is generated by
the Menu can cause the warning. I've noticed when I create a menu (I'm having
many other issues right now which I'm working through) that the page
generates LOTS of code and references a files in the head from the root
called /WebResource.axd?d=6txiuwerieurieuriu etc.

Also, any sytle sheet references would need considering too.

does this help?

There is a bug concerning SSL and ASP.Net 2.0 Menu Control

Hi all
It appears there is a bug - when using a 2 or more tier menu control in
asp.net in an SSL environment you get prompted with the:
"This page contains both secure and non-secure items blah blah"
a) has anyone else experienced?
b) if so do we know when to expect it to be fixed?
Thanks
KevMantorok wrote:
> Hi all
> It appears there is a bug - when using a 2 or more tier menu control in
> asp.net in an SSL environment you get prompted with the:
> "This page contains both secure and non-secure items blah blah"
Have you looked at the generated HTML to see if there is a mistake that
you made? I haven't used this control in an SSL environment yet so I'm
only speculating.
Good luck,
Sean
"Fao, Sean" <enceladus311@.yahoo.comI-WANT-NO-SPAM> wrote in message
news:ubV70OfFGHA.1288@.TK2MSFTNGP09.phx.gbl...
> Mantorok wrote:
> Have you looked at the generated HTML to see if there is a mistake that
> you made? I haven't used this control in an SSL environment yet so I'm
> only speculating.
Yep I've checked, I've used relative paths in my links.
Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0h62$nmc$1@.newsfeed.th.ifl.net...

> Yep I've checked, I've used relative paths in my links.
Do any of the links point to resources in non-SSL locations? If so, you will
get the message box by default when you access an SSL page which contains
links to non-SSL resources.
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:Oub62lfFGHA.1676@.TK2MSFTNGP09.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0h62$nmc$1@.newsfeed.th.ifl.net...
>
> Do any of the links point to resources in non-SSL locations? If so, you
> will get the message box by default when you access an SSL page which
> contains links to non-SSL resources.
Yes there are links in the master page that link back to non-secure sites -
does that really make a difference? Sounds odd if it does.
Kev
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0lgl$q9r$1@.newsfeed.th.ifl.net...

> Yes there are links in the master page that link back to non-secure
> sites -
There's your problem...

> does that really make a difference?
Yes.

> Sounds odd if it does.
Perfectly logical if you think about it...
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:eGZYZCgFGHA.1676@.TK2MSFTNGP09.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0lgl$q9r$1@.newsfeed.th.ifl.net...
>
> There's your problem...
>
> Yes.
>
> Perfectly logical if you think about it...
Wait a minute - do you mean hyperlinks or just linking to non-secure stuff,
if you mean the latter then no, but the former - yes.
Kev
most likely you are referencing an image over http. the easiest way to find
the reference is to use firefox, and goto to the media tab on the pageinfo,
you will see the http reference.
-- bruce (sqlwork.com)
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0gjm$nbo$1@.newsfeed.th.ifl.net...
> Hi all
> It appears there is a bug - when using a 2 or more tier menu control in
> asp.net in an SSL environment you get prompted with the:
> "This page contains both secure and non-secure items blah blah"
> a) has anyone else experienced?
> b) if so do we know when to expect it to be fixed?
> Thanks
> Kev
>
"Mantorok" <mantorok@.mantorok.com> wrote in message
news:dq0nd6$rbg$1@.newsfeed.th.ifl.net...

> Wait a minute - do you mean hyperlinks or just linking to non-secure
> stuff, if you mean the latter then no, but the former - yes.
Either; both; whatever - that's the way it is...
"Mark Rae" <mark@.markN-O-S-P-A-M.co.uk> wrote in message
news:eQVWamnFGHA.3064@.TK2MSFTNGP10.phx.gbl...
> "Mantorok" <mantorok@.mantorok.com> wrote in message
> news:dq0nd6$rbg$1@.newsfeed.th.ifl.net...
>
> Either; both; whatever - that's the way it is...
I don't think so - a hyperlink on a SSL site pointing to HTTP is not classed
as containing a non-secure item.
Firefox doesn't seem to give me this message, only IE...
Kev

Wednesday, March 28, 2012

They LIED!

I have designed a custom control and have been trying to set the TagPrefix and ToolBoxBitmap image to the control, but none of it is working!

Adding the TagPrefix to the control

To set the TagPrefix it's says to do this

'Within the AssemblyInfo.vb file add this
Imports System.Web.UI

'<Assembly: TagPrefix("Namespace Name", "TagPrefix")>
<Assembly: TagPrefix("JHAControls", "JHA")>

When I add my control to the page it shows up as this in the HTML

<%@dotnet.itags.org. Register TagPrefix="cc1" Namespace="JHACustomControls.JHAControls" Assembly="JHACustomControls" %>

the TagPrefix should be "JHA", not "cc1", which is the default.

Why doesn't this doesn't work!?

Adding an icon to the custom control
To add an icon to the custom control, it says to do this.
Assuming the icon is the same name as your class, which it is (JHATextBox class, and JHATextBox.bmp icon)

1) Create a 16x16 pixel bmp icon. which I did.
2) Add the icon to the project, which I did.
3) Set the icons build action to "Embedded Resource", which I did
4) Rebuild the project and the icon will display in the toolbox when the control is added.

This doesn't work either, I still get the default "gears" icon.

I can get the icon to work, but only if I specify the absolute path to the file (C:\MyFolder\MyFile.bmp). But then the control (.dll file) doesn't work on another computer unless the image exists in the same location on that computer.

Anyone know why these aren't working??I finally got the first part (TagPrefix) working...It isnt' only the namespace name that is needed...it is the SolutionName.Namespace name.

So instead of

<Assembly: TagPrefix("JHAControls", "JHA")>

it had to be

<Assembly: TagPrefix("JHACustomControls.JHAControls", "JHA")>

Where JHACustomControls is the name of the solution or project, then the namespace.

I still haven't figured out the icon part though.
I got it all fixed.
I removed the namespace from my class and the icon displayed just fine.
Thanks for the help!
What Help ?

I should be thanking you as you are miles ahead of me in .net.
I am finding it very difficult. Especially ADO.net.
I was being sarcastic, as it doesn't appear that anyone here has done, what I was trying to do.

.NET is pretty straight forward once you understand the basics.
If you need help just ask.
I have. I just haven't been around for a week. I have an entire toolbox tab full of controls with pretty icons. That tagPrefix is jumpy though it'll get lost and you'll have to mess with and force a full rebuild instead of the partial that is done default to fix it. And as best as I can tell you can only have one tagPrefix two even though the namespace is diffrent won't work.

Have you looked at designers yet. they are interesting to say the least.

Third party control on page

Hi All,
I added one ActiveX control to the web page from html source.
<OBJECT id="MyWinControl1" height="147" width="186"
classid="http:ActiveXDotNet.dll#ActiveXDotNet.myControl" ></OBJECT>
How can I access this control(MyWinControl1) in my aspx.cs ?
I am new to the web applications. Please help me.
Thank you,
Supriyatry place a "runat" property in <object> like this
<objec runat="server" id="mycontrol">
Then you will be able to access the control using object variable mycontrol
in aspx.cs

Third party control on page

Hi All,
I added one ActiveX control to the web page from html source.
<OBJECT id="MyWinControl1" height="147" width="186"
classid="http:ActiveXDotNet.dll#ActiveXDotNet.myControl" ></OBJECT>

How can I access this control(MyWinControl1) in my aspx.cs ?

I am new to the web applications. Please help me.

Thank you,

Supriyatry place a "runat" property in <objectlike this
<objec runat="server" id="mycontrol">
Then you will be able to access the control using object variable mycontrol
in aspx.cs
I tried this option.It is not working.
When I try to add ActiveX Control from the "Choose Tool Box Items",Why it is
not coming in tool box items?But my ActiveX control is coming in "Choose
Tool Box Items".Any Idea?

"(Nocky Tian)" <tiannocky@.msn.comwrote in message
news:231D28B8-128F-4EB2-B2F7-F21436C51586@.microsoft.com...

Quote:

Originally Posted by

try place a "runat" property in <objectlike this
<objec runat="server" id="mycontrol">
Then you will be able to access the control using object variable
mycontrol in aspx.cs

Third Party Control

I am trying to implement the SmartScroller control (free control from http://www.strengthtechnologies.com/) into my WebApp. It is supposed to retain scroll position after a postback. I'm having difficulty adding it to my project however. When I try to add the SmartScroller to my toolbox I get this message...

"There are no components in 'C:\Inetpub\wwwroot\webapp\bin\StrengthControls.Scrolling.dll' that can be placed on the toolbox.

I've also tried to register it manually...

<%@dotnet.itags.org. Register TagPrefix="ccl" Namespace="StrengthControls.Scrolling" Assembly="StrengthControls" %>

but I get a parser error: File or assembly name StrengthControls, or one of its dependencies, was not found.

I've included StrengthControls.Scrolling.dll in the bin directory of my webapp just like it says to do on the http://www.strengthtechnologies.com/ site so I have no clue why this isn't working. Any help would be much appreciated.Why not just using Smartnavigation property?
I've heard that SmartNavigation is unreliable and I've encountered strange problems when I've implemented it in the past.

Third Party Controls

Hi!
Is there any third party controls like Tab Control to be use in
ASP.Net?
Thanks
MacGoogle is your friend for this sort of question:
http://www.google.com/search?hl=en&...NET+Tab+Control
Also I can recommend the controls offered by ComponentArt.
www.componentart.com
-HTH
"mac" <markvergara007@.hotmail.com> wrote in message
news:%235rqILsgGHA.3456@.TK2MSFTNGP05.phx.gbl...
> Hi!
>
> Is there any third party controls like Tab Control to be use in
> ASP.Net?
>
> Thanks
> Mac
>

www.telerik.com the are the best
"Jeremy S." <A@.B.COM> wrote in message
news:OKTBa8sgGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Google is your friend for this sort of question:
> http://www.google.com/search?hl=en&...NET+Tab+Control
> Also I can recommend the controls offered by ComponentArt.
> www.componentart.com
>
> -HTH
>
> "mac" <markvergara007@.hotmail.com> wrote in message
> news:%235rqILsgGHA.3456@.TK2MSFTNGP05.phx.gbl...
>

Third Party Controls

Hi!

Is there any third party controls like Tab Control to be use in
ASP.Net?

Thanks
MacGoogle is your friend for this sort of question:
http://www.google.com/search?hl=en&...NET+Tab+Control

Also I can recommend the controls offered by ComponentArt.
www.componentart.com

-HTH

"mac" <markvergara007@.hotmail.com> wrote in message
news:%235rqILsgGHA.3456@.TK2MSFTNGP05.phx.gbl...
> Hi!
>
> Is there any third party controls like Tab Control to be use in
> ASP.Net?
>
> Thanks
> Mac

www.telerik.com the are the best

"Jeremy S." <A@.B.COM> wrote in message
news:OKTBa8sgGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Google is your friend for this sort of question:
> http://www.google.com/search?hl=en&...NET+Tab+Control
> Also I can recommend the controls offered by ComponentArt.
> www.componentart.com
>
> -HTH
>
> "mac" <markvergara007@.hotmail.com> wrote in message
> news:%235rqILsgGHA.3456@.TK2MSFTNGP05.phx.gbl...
>>
>> Hi!
>>
>>
>> Is there any third party controls like Tab Control to be use in
>> ASP.Net?
>>
>>
>> Thanks
>> Mac
>>

Third Party Tool for Audio voice recording.

I need a third party control for my web site to do Audio voice recording. Can anyone tell me which thrid Party tool i can use in my application. Technology used is Asp.net + C#.

Hi,

Check this

http://www.dotnetspider.com/code/C-470-How-record-voice-from-microphone.aspx

http://www.codeproject.com/audio/Voice_Recording.asp

http://www.codeproject.com/audio/RecordingAndMP3Encoding.asp

http://www.devx.com/dotnet/Article/11958/0/page/11


I have gone through these links.........but my requirment to get a third party tool which is compatible with asp.net + C# .

Monday, March 26, 2012

This is for the nth time I am posting. Is there no one to help!

I have a datalist control in my aspx page(this is
paginated and everytime submits to itself). I am calling a
function within my datalist that returns a html control
(radio button ) in the form of the string. I also have asp
server controls(labels) in the datalist. When the form is
processed, I am retrieving the values of the radio buttons
through Request.form. To retrieve the values of the asp
server controls , I am using FindControl method. But this
is written in the Page_Load method, so it returns the
values of the current page before the page gets submitted.
I want the values after the page gets submitted. How do I
retrieve them.
If I use onserverclick on my button (which is a html
control with rollover capability <a href>) , the onclick
doesn't work fine for validating the html controls. I
don't have runat=server on my form tag when I have onclick
attribute on the button. I am new to asp.net. I am not
able to use both onclick and onserverclick at the same
time. Why is it so..

Please help!!Maybe you could post some code. Its hard to tell what your problem is from
you message which you have posted several times.

"ani" <anonymous@.discussions.microsoft.com> wrote in message
news:01b601c3a3ce$cbdc78c0$a401280a@.phx.gbl...
> I have a datalist control in my aspx page(this is
> paginated and everytime submits to itself). I am calling a
> function within my datalist that returns a html control
> (radio button ) in the form of the string. I also have asp
> server controls(labels) in the datalist. When the form is
> processed, I am retrieving the values of the radio buttons
> through Request.form. To retrieve the values of the asp
> server controls , I am using FindControl method. But this
> is written in the Page_Load method, so it returns the
> values of the current page before the page gets submitted.
> I want the values after the page gets submitted. How do I
> retrieve them.
> If I use onserverclick on my button (which is a html
> control with rollover capability <a href>) , the onclick
> doesn't work fine for validating the html controls. I
> don't have runat=server on my form tag when I have onclick
> attribute on the button. I am new to asp.net. I am not
> able to use both onclick and onserverclick at the same
> time. Why is it so..
> Please help!!
sounds like you are not leveraging the page.postback property. page_load
gets called every time the page loads whether it is post back or not. the
onserverclicks will get loaded after page_load. sounds like you are loading
the datalist twice before doing a request.form on the data. you should only
build the datalist once. it will be in the viewstate on the postback, so no
need to reload it.

function page_load()
if page.ispostback then
'get checkbox values and labels or do nothing and rely on the
OnServerClick event
else
'load datalist
end if
end function

also if you want to use javascript onclick and asp.net's onserverclick do
this...
<input type="submit" id="btn" value="go" runat="server" onclick="return
validate();"
if you use <asp:button...>, the onclick event is looking for a public
function in the codebehind which default to private... not sure, but I have
to change that to public everytime.

again, without code samples, it is tough. I hope I helped a little bit.
~psb

"ani" <anonymous@.discussions.microsoft.com> wrote in message
news:01b601c3a3ce$cbdc78c0$a401280a@.phx.gbl...
> I have a datalist control in my aspx page(this is
> paginated and everytime submits to itself). I am calling a
> function within my datalist that returns a html control
> (radio button ) in the form of the string. I also have asp
> server controls(labels) in the datalist. When the form is
> processed, I am retrieving the values of the radio buttons
> through Request.form. To retrieve the values of the asp
> server controls , I am using FindControl method. But this
> is written in the Page_Load method, so it returns the
> values of the current page before the page gets submitted.
> I want the values after the page gets submitted. How do I
> retrieve them.
> If I use onserverclick on my button (which is a html
> control with rollover capability <a href>) , the onclick
> doesn't work fine for validating the html controls. I
> don't have runat=server on my form tag when I have onclick
> attribute on the button. I am new to asp.net. I am not
> able to use both onclick and onserverclick at the same
> time. Why is it so..
> Please help!!
This is how the presentation code look like. If I use
runat = server, ie; when I try to use onserverclick on the
button the javascript doesn't work . The displayanswers
method in the form returns a string of html text,basically
a table with radiobuttons or checkboxes aligned in it.

<form id="frmQuestion" method="post"
<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label
</td
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label
</td
<td
<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %
</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList
<table align=right >
<tr><td
<a id=btnForward href="http://links.10026.com/?link=#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A
</td></tr></table
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button. The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)

Dim oDt As DataTable
Dim oQuestion As Question ('This is the class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub

What is the best way to handle Questionaire(online test)
projects . Can I display questions and answers at the same
time and how do I get questionid's and user-input to
insert into the database. There can be subquestions
This is how the presentation code look like. If I use
runat = server, ie; when I try to use onserverclick on the
button the javascript doesn't work . The displayanswers
method in the form returns a string of html text,basically
a table with radiobuttons or checkboxes aligned in it.

<form id="frmQuestion" method="post"
<ASP:DataList id="Questions" ShowHeader="false"
ShowFooter="false" runat="server" >
<ItemTemplate>
<TABLE ALIGN="left" >
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_ID")%> '
ID="QuestionID" NAME="QuestionID">
</asp:Label
</td
<td
<asp:Label runat="server" Text='<%# DataBinder.Eval
(Container.DataItem, "MainQuestion_Txt")%>'
ID="QuestionTxt" NAME="QuestionTxt">
</asp:Label
</td
<td
<%# DisplayAnswers(DataBinder.Eval
(Container.DataItem, "MainQuestion_ID"),DataBinder.Eval
(Container.DataItem, "QuestionTypeID")) %
</td>
</tr></TABLE>
</ItemTemplate>
</ASP:DataList
<table align=right >
<tr><td
<a id=btnForward href="http://links.10026.com/?link=#"
onMouseOut="bforward.src='images/bforward.gif';"
onMouseOver="bforward.src='images/bforward_f2.gif';"
runat=server onclick="return validate();"><IMG
SRC="images/bforward.gif" ALT="" NAME="bforward"
ID="bforward" WIDTH="78" HEIGHT="24" BORDER="0"></A
</td></tr></table
I would like to retrieve the question id and the answer
(user-input) at the same time on click of the button. The
questionaire is paginated and this is the only form i am
using.

The code behind looks somewhat this way:

Sub Page_Load(ByVal Sender As Object, ByVal E As
EventArgs)

Dim oDt As DataTable
Dim oQuestion As Question ('This is the class
in my business layer)
oQuestion = New Question

Questions.DataSource = New DataView(oDt)
Questions.DataBind()

End Sub

What is the best way to handle Questionaire(online test)
projects . Can I display questions and answers at the same
time and how do I get questionid's and user-input to
insert into the database. There can be subquestions

this is strange....

Hey

asp.net 2.0

My problem is that the image web server control (see below) won't display
the image if web.config have this setting:
<authorization>
<deny users="?" />
</authorization>

<asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />

Any ideas what I should do to solve this so the image is displayed if
web.config have
<authorization>
<deny users="?" />
</authorization>

Best Regards!

JeffThis web page uses a theme

and it looks like the page can't use the theme either if
<authorization>
<deny users="?" />
</authorization>

<pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>

any suggestions?

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Hey
>
asp.net 2.0
>
My problem is that the image web server control (see below) won't display
the image if web.config have this setting:
<authorization>
<deny users="?" />
</authorization>
>
<asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>
Any ideas what I should do to solve this so the image is displayed if
web.config have
<authorization>
<deny users="?" />
</authorization>
>
>
Best Regards!
>
Jeff
>


"?" stands for anonymous users and "*" for all users. So,

<allow users="Jv"/>
<deny users="?"/>

will allow user "Jv" but deny all anonymous users. You can use to separate
multiple identiies.

<allow users="Jv, Kylin"/>
<deny users="?"/>

"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message news:OjhGjTx4GHA.4352@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

This web page uses a theme
>
and it looks like the page can't use the theme either if
<authorization>
<deny users="?" />
</authorization>
>
<pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>
>
any suggestions?
>
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Hey
>>
>asp.net 2.0
>>
>My problem is that the image web server control (see below) won't display the image if web.config have this setting:
><authorization>
> <deny users="?" />
></authorization>
>>
><asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>>
>Any ideas what I should do to solve this so the image is displayed if web.config have
><authorization>
> <deny users="?" />
></authorization>
>>
>>
>Best Regards!
>>
>Jeff
>>


>
>


thanks!

"Jon Paal" <Jon[ nospam ]Paal @. everywhere dot comwrote in message
news:OIVEUIz4GHA.3512@.TK2MSFTNGP04.phx.gbl...

Quote:

Originally Posted by

"?" stands for anonymous users and "*" for all users. So,
>
<allow users="Jv"/>
<deny users="?"/>
>
will allow user "Jv" but deny all anonymous users. You can use to separate
multiple identiies.
>
<allow users="Jv, Kylin"/>
<deny users="?"/>
>
>
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OjhGjTx4GHA.4352@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

>This web page uses a theme
>>
>and it looks like the page can't use the theme either if
><authorization>
> <deny users="?" />
></authorization>
>>
><pages theme="Standard" maintainScrollPositionOnPostBack="true"></pages>
>>
>any suggestions?
>>
>>
>"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
>news:OFg7n$w4GHA.1460@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>Hey
>>>
>>asp.net 2.0
>>>
>>My problem is that the image web server control (see below) won't
>>display the image if web.config have this setting:
>><authorization>
>> <deny users="?" />
>></authorization>
>>>
>><asp:Image ID="logo" runat="server" ImageUrl="~/logo.png" />
>>>
>>Any ideas what I should do to solve this so the image is displayed if
>>web.config have
>><authorization>
>> <deny users="?" />
>></authorization>
>>>
>>>
>>Best Regards!
>>>
>>Jeff
>>>


>>
>>


>
>

Saturday, March 24, 2012

This shouldn't be this hard

Hello,
I need to connect a treeview control to and Access database.
It seems that I can only use a site map or a XML file. I cannot
figure out why there is not a choice for any other databases.
I was thinking about using ADO.net code but I wanted to find out if
there is a better way. I am using Visual Web Developer 2008.
Thanks for any help or examples.
TyOn Mar 5, 5:08=A0pm, Ty <tbar...@.lewistownhospital.org> wrote:
> Hello,
> =A0 I need to connect a treeview control to and Access database.
> =A0 It seems that I can only use a site map or a XML file. I cannot
> figure out why there is not a choice for any other databases.
> =A0 I was thinking about using ADO.net code but I wanted to find out if
> there is a better way. I am using Visual Web Developer 2008.
> Thanks for any help or examples.
> Ty
http://forums.asp.net/t/339295.aspx

this.Controls.Add(Control) Does Not Add Control to child collection (this.Controls.Count =

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:

for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);

foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);

HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}

The amazing thing is here, that the Label control and the HoverMenuExtender
AJAX Toolkit control both get added just fine, however I added a watch on
this.Controls.Count for the line where I add my FloatingMenu control
collection, "_menus", and after each call to "this.Controls.Add(_menus[i]);"
the Count is 0, however after I add the label it's 1 and the extender it's
2.

I'm stumped.

Thanks,
ChadWhat is the value of _menus.Count before the for loop

"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:
>
for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);
>
foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);
>
HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}
>
>
The amazing thing is here, that the Label control and the
HoverMenuExtender AJAX Toolkit control both get added just fine, however I
added a watch on this.Controls.Count for the line where I add my
FloatingMenu control collection, "_menus", and after each call to
"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
label it's 1 and the extender it's 2.
>
I'm stumped.
>
Thanks,
Chad
>


_menus.Count is 2 before the loop. And the second, foreach loop adds 2
Labels and 2 HoverMenuExtenders as it should. I tried the first loop with a
foreach initially, but remembering SyncRoot issues and thought perhaps the
enumerator was breaking the Add operation, I changed it to the for loop to
no avail.

"IfThenElse" <sql_agentman@.hotmail.comwrote in message
news:%23D0oraEEIHA.6120@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

What is the value of _menus.Count before the for loop
>
>
"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

>Ok, as silly as it may sound, I have a situation where I am creating a
>CompositeControl in ASP.NET 2.0, C#. I have the following code in the
>CreateChildControls() method that build the control's child control
>collection:
>>
>for (int i = 0; i < _menus.Count; i++)
>this.Controls.Add(_menus[i]);
>>
>foreach (FloatingMenu menu in _menus)
>{
>Label lbl = new Label();
>lbl.ID = string.Concat("GroupQ", menu.ID);
>lbl.CssClass = "menuItemGroupHeader";
>lbl.Text = menu.GroupName;
>this.Controls.Add(lbl);
>>
>HoverMenuExtender extender = new HoverMenuExtender();
>extender.ID = string.Concat("ExtenderQ", menu.ID);
>extender.TargetControlID = lbl.ID;
>extender.PopupControlID = menu.ID;
>extender.PopupPosition = HoverMenuPopupPosition.Bottom;
>this.Controls.Add(extender);
>}
>>
>>
>The amazing thing is here, that the Label control and the
>HoverMenuExtender AJAX Toolkit control both get added just fine, however
>I added a watch on this.Controls.Count for the line where I add my
>FloatingMenu control collection, "_menus", and after each call to
>"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
>label it's 1 and the extender it's 2.
>>
>I'm stumped.
>>
>Thanks,
>Chad
>>


>
>


Does anyone have any clue why this would happen? I'm still banging my head
against a wall trying to figure this out.

"Chad Scharf" <chadscharf@.community.nospamwrote in message
news:%23qrSW5CEIHA.5752@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Ok, as silly as it may sound, I have a situation where I am creating a
CompositeControl in ASP.NET 2.0, C#. I have the following code in the
CreateChildControls() method that build the control's child control
collection:
>
for (int i = 0; i < _menus.Count; i++)
this.Controls.Add(_menus[i]);
>
foreach (FloatingMenu menu in _menus)
{
Label lbl = new Label();
lbl.ID = string.Concat("GroupQ", menu.ID);
lbl.CssClass = "menuItemGroupHeader";
lbl.Text = menu.GroupName;
this.Controls.Add(lbl);
>
HoverMenuExtender extender = new HoverMenuExtender();
extender.ID = string.Concat("ExtenderQ", menu.ID);
extender.TargetControlID = lbl.ID;
extender.PopupControlID = menu.ID;
extender.PopupPosition = HoverMenuPopupPosition.Bottom;
this.Controls.Add(extender);
}
>
>
The amazing thing is here, that the Label control and the
HoverMenuExtender AJAX Toolkit control both get added just fine, however I
added a watch on this.Controls.Count for the line where I add my
FloatingMenu control collection, "_menus", and after each call to
"this.Controls.Add(_menus[i]);" the Count is 0, however after I add the
label it's 1 and the extender it's 2.
>
I'm stumped.
>
Thanks,
Chad
>

Thursday, March 22, 2012

Thoughts please

I'm struggling to get my head round this problem at the moment so'd appreciate and guidance.

I have a menu control that I've decided to store in application cache because I don't need it continually getting re-created. I have now installed the Control Adapters classes. I now have a problem in that whilst the menu gets recreated and rendered as expected, the oninit of the control adapter function that creates the javascript does not(meaning the menu dropdowns don't work) because the control already exists in memory I guess. So any ideas on a good way to overcome this problem?

I'll post up any more info if that's not clear?

thanks

I don't really see the point behind explicitly storing the menu in the application cache, asp.net apps seem to store things in cache unless you explicitly tell it not to.

Hmmm, I maybe getting confused or making this a bit too complicated;

My main reasoning is that the Menu can appear on any aspx page and can appear anywhere in the pages content(it's user defined). By storing it in cache I can call the menus Render method and have it created whenever it has been including by the user. It's not in a static place on the form. This all seems to work btw, it's just not calling OnInit which the control adapter relies on

if that makes sense


This is now fixed but thanks tf for the reply

Tuesday, March 13, 2012

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.
In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.
It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"
Doing some googling suggested that I use
Response.Redirect("./myurl.aspx?ID=" + variable,false);
to allow the current thread to continue executing.
This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..
e.g. instead of looking like this...
http://www.website.com/myurl.aspx?ID=5
it looks like
http://www.website.com/myurl.aspx
It's like the redirect *never* happens...
Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
>
>
Hi Steve, you mean like this?
try
{
Response.Redirect("./myurl.aspx?ID=" + variable);
}catch (Exception ex)
{
}
I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...
Thanks again Steve..
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>
Yes, that's what I'm suggesting. Does it work for you?
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>
Hi Steve, no unfortunately not.
I did a try catch and caught the exception like so:
catch (Exception ex)
Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib
Thanks again for your help
Cheers
Mark
"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.
Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>

Thread was being aborted error message

Hi all, I have a user control which raises an event to the parent page when
a person clicks on a link in a datagrid.

In the event handler inside the parent page I construct a url to redirect to
containing information sent from the datagrid.

It all works fine on my local machine but when I send it to the live server
I receive "The thread was being aborted"

Doing some googling suggested that I use

Response.Redirect("./myurl.aspx?ID=" + variable,false);

to allow the current thread to continue executing.

This stops the error but what I am now finding is that the redirect does not
have the querystring attributes attached to it..

e.g. instead of looking like this...

http://www.website.com/myurl.aspx?ID=5

it looks like

http://www.website.com/myurl.aspx

It's like the redirect *never* happens...

Help appreciated
Thanks
MarkPut your Response.Redirect back to the way it was, without the false
parameter.
Then wrap it in a Try/Catch statement to eat the error that's raised from
the redirect.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
> Hi all, I have a user control which raises an event to the parent page
> when a person clicks on a link in a datagrid.
> In the event handler inside the parent page I construct a url to redirect
> to containing information sent from the datagrid.
> It all works fine on my local machine but when I send it to the live
> server I receive "The thread was being aborted"
> Doing some googling suggested that I use
> Response.Redirect("./myurl.aspx?ID=" + variable,false);
> to allow the current thread to continue executing.
> This stops the error but what I am now finding is that the redirect does
> not have the querystring attributes attached to it..
> e.g. instead of looking like this...
> http://www.website.com/myurl.aspx?ID=5
> it looks like
> http://www.website.com/myurl.aspx
>
> It's like the redirect *never* happens...
> Help appreciated
> Thanks
> Mark
Hi Steve, you mean like this?

try
{
Response.Redirect("./myurl.aspx?ID=" + variable);

}catch (Exception ex)
{

}

I have seen other people say take the Response.Redirect("./myurl.aspx?ID=" +
variable,false) out of the try catch block...
I understand why this is hapenning but cannot understand how to fix it...

Thanks again Steve..
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
> Put your Response.Redirect back to the way it was, without the false
> parameter.
> Then wrap it in a Try/Catch statement to eat the error that's raised from
> the redirect.
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>> Hi all, I have a user control which raises an event to the parent page
>> when a person clicks on a link in a datagrid.
>>
>> In the event handler inside the parent page I construct a url to redirect
>> to containing information sent from the datagrid.
>>
>> It all works fine on my local machine but when I send it to the live
>> server I receive "The thread was being aborted"
>>
>> Doing some googling suggested that I use
>>
>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>
>> to allow the current thread to continue executing.
>>
>> This stops the error but what I am now finding is that the redirect does
>> not have the querystring attributes attached to it..
>>
>> e.g. instead of looking like this...
>>
>> http://www.website.com/myurl.aspx?ID=5
>>
>> it looks like
>>
>> http://www.website.com/myurl.aspx
>>
>>
>> It's like the redirect *never* happens...
>>
>> Help appreciated
>> Thanks
>> Mark
>>
>>
>>
Yes, that's what I'm suggesting. Does it work for you?

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Jimi" <dontspam@.me.com> wrote in message
news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
> Hi Steve, you mean like this?
> try
> {
> Response.Redirect("./myurl.aspx?ID=" + variable);
> }catch (Exception ex)
> {
> }
> I have seen other people say take the Response.Redirect("./myurl.aspx?ID="
> + variable,false) out of the try catch block...
> I understand why this is hapenning but cannot understand how to fix it...
> Thanks again Steve..
> Cheers
> Mark
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>> Put your Response.Redirect back to the way it was, without the false
>> parameter.
>> Then wrap it in a Try/Catch statement to eat the error that's raised from
>> the redirect.
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>> Hi all, I have a user control which raises an event to the parent page
>>> when a person clicks on a link in a datagrid.
>>>
>>> In the event handler inside the parent page I construct a url to
>>> redirect to containing information sent from the datagrid.
>>>
>>> It all works fine on my local machine but when I send it to the live
>>> server I receive "The thread was being aborted"
>>>
>>> Doing some googling suggested that I use
>>>
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>
>>> to allow the current thread to continue executing.
>>>
>>> This stops the error but what I am now finding is that the redirect does
>>> not have the querystring attributes attached to it..
>>>
>>> e.g. instead of looking like this...
>>>
>>> http://www.website.com/myurl.aspx?ID=5
>>>
>>> it looks like
>>>
>>> http://www.website.com/myurl.aspx
>>>
>>>
>>> It's like the redirect *never* happens...
>>>
>>> Help appreciated
>>> Thanks
>>> Mark
>>>
>>>
>>>
>>
>>
Hi Steve, no unfortunately not.

I did a try catch and caught the exception like so:

catch (Exception ex)

Output of ex.Message was Thread was being aborted.
and ex.Source = mscorlib

Thanks again for your help
Cheers
Mark

"Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
> Yes, that's what I'm suggesting. Does it work for you?
> --
> I hope this helps,
> Steve C. Orr, MCSD, MVP
> http://SteveOrr.net
>
> "Jimi" <dontspam@.me.com> wrote in message
> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>> Hi Steve, you mean like this?
>>
>> try
>> {
>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>
>> }catch (Exception ex)
>> {
>>
>> }
>>
>> I have seen other people say take the
>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>> catch block...
>> I understand why this is hapenning but cannot understand how to fix it...
>>
>> Thanks again Steve..
>> Cheers
>> Mark
>>
>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>> Put your Response.Redirect back to the way it was, without the false
>>> parameter.
>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>> from the redirect.
>>>
>>> --
>>> I hope this helps,
>>> Steve C. Orr, MCSD, MVP
>>> http://SteveOrr.net
>>>
>>>
>>>
>>> "Jimi" <dontspam@.me.com> wrote in message
>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>> Hi all, I have a user control which raises an event to the parent page
>>>> when a person clicks on a link in a datagrid.
>>>>
>>>> In the event handler inside the parent page I construct a url to
>>>> redirect to containing information sent from the datagrid.
>>>>
>>>> It all works fine on my local machine but when I send it to the live
>>>> server I receive "The thread was being aborted"
>>>>
>>>> Doing some googling suggested that I use
>>>>
>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>
>>>> to allow the current thread to continue executing.
>>>>
>>>> This stops the error but what I am now finding is that the redirect
>>>> does not have the querystring attributes attached to it..
>>>>
>>>> e.g. instead of looking like this...
>>>>
>>>> http://www.website.com/myurl.aspx?ID=5
>>>>
>>>> it looks like
>>>>
>>>> http://www.website.com/myurl.aspx
>>>>
>>>>
>>>> It's like the redirect *never* happens...
>>>>
>>>> Help appreciated
>>>> Thanks
>>>> Mark
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
Hi all, in the end due to time constraints I used a JavaScript redirect and
now it all works fine.

Thanks for your help Steve :)
Cheers
Mark
"Jimi" <dontspam@.me.com> wrote in message
news:uq2px$FXGHA.752@.TK2MSFTNGP02.phx.gbl...
> Hi Steve, no unfortunately not.
> I did a try catch and caught the exception like so:
> catch (Exception ex)
> Output of ex.Message was Thread was being aborted.
> and ex.Source = mscorlib
> Thanks again for your help
> Cheers
> Mark
>
>
> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
> news:OlCNUwFXGHA.3848@.TK2MSFTNGP05.phx.gbl...
>> Yes, that's what I'm suggesting. Does it work for you?
>>
>> --
>> I hope this helps,
>> Steve C. Orr, MCSD, MVP
>> http://SteveOrr.net
>>
>>
>> "Jimi" <dontspam@.me.com> wrote in message
>> news:efW%23QfEXGHA.4324@.TK2MSFTNGP03.phx.gbl...
>>> Hi Steve, you mean like this?
>>>
>>> try
>>> {
>>> Response.Redirect("./myurl.aspx?ID=" + variable);
>>>
>>> }catch (Exception ex)
>>> {
>>>
>>> }
>>>
>>> I have seen other people say take the
>>> Response.Redirect("./myurl.aspx?ID=" + variable,false) out of the try
>>> catch block...
>>> I understand why this is hapenning but cannot understand how to fix
>>> it...
>>>
>>> Thanks again Steve..
>>> Cheers
>>> Mark
>>>
>>> "Steve C. Orr [MVP, MCSD]" <Steve@.Orr.net> wrote in message
>>> news:eaqxRZEXGHA.3660@.TK2MSFTNGP04.phx.gbl...
>>>> Put your Response.Redirect back to the way it was, without the false
>>>> parameter.
>>>> Then wrap it in a Try/Catch statement to eat the error that's raised
>>>> from the redirect.
>>>>
>>>> --
>>>> I hope this helps,
>>>> Steve C. Orr, MCSD, MVP
>>>> http://SteveOrr.net
>>>>
>>>>
>>>>
>>>> "Jimi" <dontspam@.me.com> wrote in message
>>>> news:uls70dBXGHA.1352@.TK2MSFTNGP05.phx.gbl...
>>>>> Hi all, I have a user control which raises an event to the parent page
>>>>> when a person clicks on a link in a datagrid.
>>>>>
>>>>> In the event handler inside the parent page I construct a url to
>>>>> redirect to containing information sent from the datagrid.
>>>>>
>>>>> It all works fine on my local machine but when I send it to the live
>>>>> server I receive "The thread was being aborted"
>>>>>
>>>>> Doing some googling suggested that I use
>>>>>
>>>>> Response.Redirect("./myurl.aspx?ID=" + variable,false);
>>>>>
>>>>> to allow the current thread to continue executing.
>>>>>
>>>>> This stops the error but what I am now finding is that the redirect
>>>>> does not have the querystring attributes attached to it..
>>>>>
>>>>> e.g. instead of looking like this...
>>>>>
>>>>> http://www.website.com/myurl.aspx?ID=5
>>>>>
>>>>> it looks like
>>>>>
>>>>> http://www.website.com/myurl.aspx
>>>>>
>>>>>
>>>>> It's like the redirect *never* happens...
>>>>>
>>>>> Help appreciated
>>>>> Thanks
>>>>> Mark
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>

Thread was being aborted exception in user control

I have an .ascx user control for creating dynamic charts from a datatable, which uses an external .aspx page for rendering the chart as a .png image. The control is not functioning as expected (ie. the chart image is not being saved in the specified folder), with the containing page catching a "Thread was being aborted" exception. The containing page itself is rendered correctly, and there is no further use of Response.Redirect or Server.Transfer after the page is loaded. Could the exception arise from the statement within the code behind file of the control where the control's image source is set:
imgGDI.imageURL = "somepage.apsx"
or is the only source likely to be the previous Server.Transfer call to the containing page? I have read other threads regarding the 'Thread was being aborted' exception and Try...Catch blocks, but the solutions detailed do not seem to have any effect.
Any suggestions most welcome.The Thread being aborted exception is the natural generation of a Server.Transfer or Response.Redirect. However a Reponse.Redirect has an option to supress the exception. Response.Redirect("foo.aspx", false);
We're using Server.Transfer("foo.aspx", false). The problem seems to be intermittant at the moment though, which is why I thought the problem may be to do with the external .aspx pages being used for the image source.