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

Thursday, March 29, 2012

official alternative to ajax

Hi

I have asked this on the official asp.net forums but no luck so
thought I'd try here

Assume you have a page with a filter control and a grid view and many
other controls on it. When the filter changes you want the gridview to
change but nothing else. In particular all you would like to happen is
for an ajax call to occur and a new grid view to be returned.

Similarily you might have a treeview working asynchronously, you might
have an n'tiered arrangment and if the database disappears you would
want a different control on the page to indicate this, but the treeview
can't be connected to other controls in this manner (can it?)

That kind of situation is possible with Raw html and Ajax. Obviously
ajax calls are easy enough (especially using something like AjaxPro)
and to get the a table back you could just create it and return it.
Similiarly for the treeview example you could return an li/ul structure
normally plus a different control to indicate the error.

So, my question. What is the official way to do things like this. I
suspect the answer is use a postback

ta

(sig: findbyfoldface)I see a lot of people trying to avoid postback, as they feel painting the
page over again is somehow inferior to doing some voodoo in the back with
Ajax. And, in some cases, they are correct. In others, they are creating two
data transports that they have to maintain, simply to avoid a repaint. I do
not see this as a wise use of Ajax, but everyone has their own opinion.

You can talk to controls all day long on the client side and even wire them
to Ajax calls. If you like, you can code your own via the XMLHTTP and with
SOAP even make true web service calls from the client. As long as you emit
the client script from your code beside (behind?) page, you can get the name
of the control, no matter where it is placed, and you can then have one
control pounding on another without a complete postback.

The question is whether you want to maintain this architecture.

PROS
1. It does not completely repaint the page

CONS
1. Harder to debug a mix of client and server script
2. Less maintainable

The main benefit of Ajax (yes, I realize there are many other reasons to use
it ;->) is user accessibility. For example, the google toolbar approach
where a drop down is created on the fly or the ability to change states
based on a country, or fill in a list of cities based on a postal code.
These are very valid reasons to use an asyncrhronous transport. I do not, in
general, believe that gathering a full spreadsheet of data is the best use
for asynch (although there are certainly some specific examples when it
would be wise).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
*************************************************
Think outside of the box!
*************************************************
<codefragment@.googlemail.comwrote in message
news:1159878333.734722.257200@.e3g2000cwe.googlegro ups.com...

Quote:

Originally Posted by

Hi
>
I have asked this on the official asp.net forums but no luck so
thought I'd try here
>
Assume you have a page with a filter control and a grid view and many
other controls on it. When the filter changes you want the gridview to
change but nothing else. In particular all you would like to happen is
for an ajax call to occur and a new grid view to be returned.
>
Similarily you might have a treeview working asynchronously, you might
have an n'tiered arrangment and if the database disappears you would
want a different control on the page to indicate this, but the treeview
can't be connected to other controls in this manner (can it?)
>
That kind of situation is possible with Raw html and Ajax. Obviously
ajax calls are easy enough (especially using something like AjaxPro)
and to get the a table back you could just create it and return it.
Similiarly for the treeview example you could return an li/ul structure
normally plus a different control to indicate the error.
>
So, my question. What is the official way to do things like this. I
suspect the answer is use a postback
>
ta
>
(sig: findbyfoldface)
>

official alternative to ajax

Hi
I have asked this on the official asp.net forums but no luck so
thought I'd try here
Assume you have a page with a filter control and a grid view and many
other controls on it. When the filter changes you want the gridview to
change but nothing else. In particular all you would like to happen is
for an ajax call to occur and a new grid view to be returned.
Similarily you might have a treeview working asynchronously, you might
have an n'tiered arrangment and if the database disappears you would
want a different control on the page to indicate this, but the treeview
can't be connected to other controls in this manner (can it?)
That kind of situation is possible with Raw html and Ajax. Obviously
ajax calls are easy enough (especially using something like AjaxPro)
and to get the a table back you could just create it and return it.
Similiarly for the treeview example you could return an li/ul structure
normally plus a different control to indicate the error.
So, my question. What is the official way to do things like this. I
suspect the answer is use a postback
ta
(sig: findbyfoldface)I see a lot of people trying to avoid postback, as they feel painting the
page over again is somehow inferior to doing some voodoo in the back with
Ajax. And, in some cases, they are correct. In others, they are creating two
data transports that they have to maintain, simply to avoid a repaint. I do
not see this as a wise use of Ajax, but everyone has their own opinion.
You can talk to controls all day long on the client side and even wire them
to Ajax calls. If you like, you can code your own via the XMLHTTP and with
SOAP even make true web service calls from the client. As long as you emit
the client script from your code beside (behind?) page, you can get the name
of the control, no matter where it is placed, and you can then have one
control pounding on another without a complete postback.
The question is whether you want to maintain this architecture.
PROS
1. It does not completely repaint the page
CONS
1. Harder to debug a mix of client and server script
2. Less maintainable
The main benefit of Ajax (yes, I realize there are many other reasons to use
it ;-> ) is user accessibility. For example, the google toolbar approach
where a drop down is created on the fly or the ability to change states
based on a country, or fill in a list of cities based on a postal code.
These are very valid reasons to use an asyncrhronous transport. I do not, in
general, believe that gathering a full spreadsheet of data is the best use
for asynch (although there are certainly some specific examples when it
would be wise).
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
*********
Think outside of the box!
****************************************
*********
<codefragment@.googlemail.com> wrote in message
news:1159878333.734722.257200@.e3g2000cwe.googlegroups.com...
> Hi
> I have asked this on the official asp.net forums but no luck so
> thought I'd try here
> Assume you have a page with a filter control and a grid view and many
> other controls on it. When the filter changes you want the gridview to
> change but nothing else. In particular all you would like to happen is
> for an ajax call to occur and a new grid view to be returned.
> Similarily you might have a treeview working asynchronously, you might
> have an n'tiered arrangment and if the database disappears you would
> want a different control on the page to indicate this, but the treeview
> can't be connected to other controls in this manner (can it?)
> That kind of situation is possible with Raw html and Ajax. Obviously
> ajax calls are easy enough (especially using something like AjaxPro)
> and to get the a table back you could just create it and return it.
> Similiarly for the treeview example you could return an li/ul structure
> normally plus a different control to indicate the error.
> So, my question. What is the official way to do things like this. I
> suspect the answer is use a postback
> ta
> (sig: findbyfoldface)
>

Monday, March 26, 2012

OK, What am I missing?@!?

I'm playing with Visual Web Developer 2005 Express Edition, coming from VisualStudio 2003.net.
I have a user control in the [application root]/util/controls directory. I have another control in that directory that needs to use the first control. I have in the ascx file of the second control the following line:

<%@dotnet.itags.org. Register TagPrefix="uc2" TagName="BannerTop" src="http://pics.10026.com/?src=/Util/Controls/BannerTop.ascx" %>
When I try to use the control (<uc2:BannerTopID="BannerTop1"runat="server"/>)I get an error saying that the file located at ~Util/Controls/Util/Controls/BannerTop.ascx could not be found (NOTE the duplicated path and the ~, I think indicating that it's trying to do a relative path).
WHY? Who the heck told it to use a relative path (NOTE the "/" at the beginning of the SRC line!)
Even when I delete the embedded control and then drag it in using the Visual Web Developer 2005 express edition, it does the same thing! Very frustrating
Am I missing something?
TIA,

When you say:

When I try to use the control (<uc2:BannerTopID="BannerTop1"runat="server"/>)



What exactly do you mean by this? Are you trying to reference this control in code?

I'm trying to put the control on the web page in the aspx file.
Confused [*-)] Did this syntax radically change with 2.0?
Pretty standard syntax in 1.1 to put a user control on a web page (See page 63 of the Microsoft Press book "Developing Microsoft ASP.Net Server Controls and Components" by Kothari and Datye)... I use it all over my 1.1 site....


For example:

<%@.PageLanguage="vb"AutoEventWireup="false"Inherits="cwsBackOffice.index"CodeFile="index.aspx.vb" %>
<%@.RegisterSrc="/Util/Controls/cwsbackofficecontainer.ascx"TagName="cwsbackofficecontainer"TagPrefix="uc1" %>
<!DOCTYPEHTMLPUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>
index
</title>
<body>
<formid="Form1"method="post"runat="server">
<uc1:cwsbackofficecontainerid="Cwsbackofficecontainer1"runat="server">
</uc1:cwsbackofficecontainer>
</form>
</body>

One thing I notice is that when dragging a UC into a Web Form (Html View or Design View doesn't matter in VS 2005), the Tilde (~) is inserted by default. This makes sense as Physical Path detection with the advent of Master Pages and storing systems for UCs etc should not be a concern of the developer. Example below showing how the .ascx file is referenced in VS2005 (drag'n drop):

<%@.RegisterSrc="~/UserControls/UC_Newsmodule.ascx"TagName="newsmodule"TagPrefix="uc2"%>


Doesn't work for me, though (with a VS2003 converted project anyway). I drag it in, I get the "~/UserControls/whatever.ascx" line, but then the compiler complains that "/UserControls/UserControls/whatever.ascx" cannot be found... I went in and hand edited the line, removing the tilde, and that part worked.

Except now it still insists that it doesn't know what the TagName objectis.
I think the problem lies in that the new Visual Web Developer doesn't know which parts of the project are code-library-type-things and which are web pages, etc. The project this was converted from used several code-library objects (written by us, compiled as part of the project) that seem to have been just copied to the new web project with no information provided to the web project as to how to use them (as objects!).
For instance, we have an in-house membership object called Membership.member. In the VS2003 source project, it is identified as a separate VB project (code-library) that is then referenced in the web project. How do I do this in the new Visual Web Developer 2005? I can't seem to add a code-library object to the project.
cheers,

Saturday, March 24, 2012

Old DLL keeps comming back over and over again

I have a solution with about 6 projects (1 web project, 5 control libraries). The code is all source controlled (SVN) and the product is in an ongoing development state.

I am using a 3rd party component which recently upgraded their control from version 5.4.2 to 6.0.0, so naturally I wanted to upgrade the code I have. I open the solution in VS2005 deleted the reference to version 5.4.2 and created a new reference to version 6.0.0 and compiled. I look in the bin and 5.4.2 was just reinstated... from where? and why??

I went into C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\<project name> and cleared everything out, then repeated the steps from above and, low and behold, the 5.4.2 dll just keeps coming back.

I'm at pure frustration at this point. I never ran into situations like this in VS2003... any help would be greatly appreciated!!!!

Hi,

Make sure that version 5.4.2 dll is deleted from all folders in your web project and also delete the VSWebCache folder in Documents & Settings. Also, open your project file in NotePad and check for any references for the old dll. Remove the same if you see any such entry.

Let me know if this works.

Vivek


Hi Vivek,

All 5.4.2 dll's have been deleted, there is no project file for web applications in .NET 2.0 and I can't find the VSWebCache folder in Documents & Settings. Can you give me an exact path?

thanks.


>...there is no project file for web applications in .NET 2.0

Actually your post did not specify if you are using Web Application Project option or not (generally I avoid using the default Website model unless necessary).

In VS 2005, VSWebCache folder is not present under Documents and Settings, I gave you this option as I missed the fact that you are using VS 2005.

Coming back to your problem, if all 5.4.2 dll's have been deleted from your web project, then try to create another test project and see if the same problem occurs. Since in Website model, all files in the project folder are a part of the website, this problem should not have occured. Also try searching for old dll in your entire machine, if found, change its name for the time being.

Let me know if it works.

Vivek


It's all good ;)

I don't know why this was happenning but I found out that it was occuring only in compile time. So I simply removed the reference, added the 6.0.0 dll's manually, and simply opened the web project with my browser and it was good after that.

Strange stuff but I have learned to expect these types of unexplained behaviours from microsoft ;)


thanks again!


I just upgraded the control to version 6.0.2 and I'm going through the same problem AGAIN. I would like to know what is the path the *VS2005* goes through to pick up the dll's, meaning where does it look first, second, third and last before it pulls in old dll's. Can anyone address this issue?

I guess, visual studio .net always looks at the assembly in the bin folder, when it compiles.. Or if you referenced another project, instead of an assembly, then it would get the assembly from its object/debug folder of the referenced project..

Any here is how the runtime locates assemblies during runtime

How the Runtime Locates Assemblies

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp


Is there an equivalent article on msdn2 for .net 2.0?

noamw:

Is there an equivalent article on msdn2 for .net 2.0?

What makes you think the above article doesnt apply for .net 2.0


Good question. I guess my question is more specific and was not aimed at manually loading assemblies. That's why I was hopping to get more info from msdn2...
Anyway, let me try to throw this question out again and hopefully you can help me out.

I have a solution with 6 projects (1 web, 5 library's) and I have a third party component that is referenced both on the web project and in one of the libraries. I recently upgraded to a new version of this component. I did what I have been doing for years now: removed the existing reference, created a new reference to the new version's dll and compiled my solution. The old version kept creeping back into my bin after I compiled. So I took the next step: Cleared all the cache settings, deleted the folder from the Microsoft.Net/Framework/...etc folder (I was under the impression the dll's were cached there) deleted the old version from my bin and re-referenced the new dll in the project. Compiled... the old version somehow found it's way back to my bin.

I would like to know where VS2005 is pulling this dll over and over and over again...

does this make more/any sense now?


You said you are referencing this component in your web project as well as in another library project.. Did you remove the old reference in both the places.. ALso, go to bin/debug or obj/debug folders in both the projects and remove any old dll component and try again

Yes, sorry I forgot to mention this, I did upgrade the dll in both places. Funny thing is that the libraries reference actually held on to the new version. The bin/debug and obj/debug folders were cleared as well. I even ran a "clean solution" just in case and I still get that dll popping back in... it's driving me crazy.

thanks.


Is it possible for you to send us some trimmed down zipped non-working version of your project via email?

-Vivek


As much as it sucks... I can't. sorry :(
I'm having hte same issue. I had to re-chekcout the whole project just to get hte project to relinquish it's grips ont he old dll.? There has to be a reason for this.


Here are some things I've tried and know is a problem.


1) It's not in the GAC, so I don't know where the dll is being cached.

2) We have physically removed the dll from the project and built it. On building, it actually pulls the old version of hte DLL again

3) When we copy and paste the latest version of the DLL, it would actually overwrite the new dll with the old dll.


This is using a webservice, so there is no project file nor could we find where the referneces are that would cause this issue.? I have had this issue a few times now and would love any input people have on this.?

Thursday, March 22, 2012

OleDbDataAdapter Configuration On Server? :(

Hi,

I am using OleDbDataAdapter to implement data grid web control and to configure the database connection i have to provide it with the provider and database name... as i am using access database so i select the provider as Jet Microsoft .... and then i have to browse for my database file and the connection gets created,

Now the problem is when i post the thing on my server it still looks for the path C:\inetpub\db\..... how can i configure that for the server. I tried to change the path in code window as ../db/... somthing like that but it didnt work ... plz help.

Thanks,
imranFor a database connection you have to use a physical path and not a relative path. To do what you are looking to acomplish you have to use "server.mappath" and the virtual path as follows:"


dim DBname as string = server.mappath("mydb.mdb")

then just plug the DBname string into your connection string
Hi,

I have used the mappath thing everywhere in my code but i dont know how to use it with the OleDbDataAdapter control as when u right click on the control it gives an option to configure the control and there i am not able to find a way to relate my access database file with server mappath .. it just lets me to browse the database file on the hard drive.
plzz suggest a way,

thanks,
imran
post the code of your page and i'll show you what to do

Friday, March 16, 2012

omposite control maintainence

In order to maintain my composite controls I will need to modify them from
time to time. Are there special requirements for composite controls
development to make sure that any change to composite control will be
reflected on any page the control has been used on?On Sun, 29 Aug 2004 07:39:10 -0500, Mark Goldin <markgoldin@.comcast.net>
wrote:

> In order to maintain my composite controls I will need to modify them
> from
> time to time. Are there special requirements for composite controls
> development to make sure that any change to composite control will be
> reflected on any page the control has been used on?
>
Is versioning what you're looking for? Any new version you should update
your AssemblyInfo file as I assume you're distributing them as a dll.
Then the user code will compile against the version they want...they can
update when they want.
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Here is a problem I have.
I am modifying my custom control during a day many times.
After every modification I have to remove the control from the form, remove
reference to a dll and place control back to form in order to pick up the
changes.
Is that because I am not implementing versioning?
"Craig Deelsnyder" <cdeelsny@.no_spam_4_meyahoo.com> wrote in message
news:opsdilxui475dg5d@.g51y101...
> On Sun, 29 Aug 2004 07:39:10 -0500, Mark Goldin <markgoldin@.comcast.net>
> wrote:
>
> Is versioning what you're looking for? Any new version you should update
> your AssemblyInfo file as I assume you're distributing them as a dll.
> Then the user code will compile against the version they want...they can
> update when they want.
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET

omposite control maintainence

In order to maintain my composite controls I will need to modify them from
time to time. Are there special requirements for composite controls
development to make sure that any change to composite control will be
reflected on any page the control has been used on?On Sun, 29 Aug 2004 07:39:10 -0500, Mark Goldin <markgoldin@.comcast.net>
wrote:

> In order to maintain my composite controls I will need to modify them
> from
> time to time. Are there special requirements for composite controls
> development to make sure that any change to composite control will be
> reflected on any page the control has been used on?
>
Is versioning what you're looking for? Any new version you should update
your AssemblyInfo file as I assume you're distributing them as a dll.
Then the user code will compile against the version they want...they can
update when they want.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Here is a problem I have.
I am modifying my custom control during a day many times.
After every modification I have to remove the control from the form, remove
reference to a dll and place control back to form in order to pick up the
changes.
Is that because I am not implementing versioning?

"Craig Deelsnyder" <cdeelsny@.no_spam_4_meyahoo.com> wrote in message
news:opsdilxui475dg5d@.g51y101...
> On Sun, 29 Aug 2004 07:39:10 -0500, Mark Goldin <markgoldin@.comcast.net>
> wrote:
> > In order to maintain my composite controls I will need to modify them
> > from
> > time to time. Are there special requirements for composite controls
> > development to make sure that any change to composite control will be
> > reflected on any page the control has been used on?
> Is versioning what you're looking for? Any new version you should update
> your AssemblyInfo file as I assume you're distributing them as a dll.
> Then the user code will compile against the version they want...they can
> update when they want.
> --
> Craig Deelsnyder
> Microsoft MVP - ASP/ASP.NET

on method for handling dynamic control events

Hi Paul,
Can you pass the codes to me? I am running into some troubles with Context
menu. I had tried the 'CuttingEdge0502' context menu which is downloadable i
n
the net. I tried to add this control dynamically but it seems nothing appear
s
when I activate it. Dunno how to continue. U come across this control?
Thanks
"PJ6" wrote:

> After a couple of months of learning ASP.NET, I think I have something wor
th
> sharing.
> The purpose of this example was to create a web control that would get its
> code fired on postback, even if had been dynamically added from code withi
n
> a user event such as from a button click.
> If you like this idea and/or have something to add to it please let me kno
w.
> Paul
>
>It's all there as an attachment in my original post. I can post in in plain
text here if you can't see it.
Paul
"JJ" <JJ@.discussions.microsoft.com> wrote in message
news:E41467C7-3AC5-404E-AB4C-B4D593648983@.microsoft.com...
> Hi Paul,
> Can you pass the codes to me? I am running into some troubles with Context
> menu. I had tried the 'CuttingEdge0502' context menu which is downloadable
> in
> the net. I tried to add this control dynamically but it seems nothing
> appears
> when I activate it. Dunno how to continue. U come across this control?
> Thanks
> "PJ6" wrote:
>
Hi Paul,
Can't see the attachment. Thks!
"PJ6" wrote:

> It's all there as an attachment in my original post. I can post in in plai
n
> text here if you can't see it.
> Paul
> "JJ" <JJ@.discussions.microsoft.com> wrote in message
> news:E41467C7-3AC5-404E-AB4C-B4D593648983@.microsoft.com...
>
>

on method for handling dynamic control events

Hi Paul,

Can you pass the codes to me? I am running into some troubles with Context
menu. I had tried the 'CuttingEdge0502' context menu which is downloadable in
the net. I tried to add this control dynamically but it seems nothing appears
when I activate it. Dunno how to continue. U come across this control?

Thanks

"PJ6" wrote:

> After a couple of months of learning ASP.NET, I think I have something worth
> sharing.
> The purpose of this example was to create a web control that would get its
> code fired on postback, even if had been dynamically added from code within
> a user event such as from a button click.
> If you like this idea and/or have something to add to it please let me know.
> Paul
>It's all there as an attachment in my original post. I can post in in plain
text here if you can't see it.

Paul

"JJ" <JJ@.discussions.microsoft.com> wrote in message
news:E41467C7-3AC5-404E-AB4C-B4D593648983@.microsoft.com...
> Hi Paul,
> Can you pass the codes to me? I am running into some troubles with Context
> menu. I had tried the 'CuttingEdge0502' context menu which is downloadable
> in
> the net. I tried to add this control dynamically but it seems nothing
> appears
> when I activate it. Dunno how to continue. U come across this control?
> Thanks
> "PJ6" wrote:
>> After a couple of months of learning ASP.NET, I think I have something
>> worth
>> sharing.
>>
>> The purpose of this example was to create a web control that would get
>> its
>> code fired on postback, even if had been dynamically added from code
>> within
>> a user event such as from a button click.
>>
>> If you like this idea and/or have something to add to it please let me
>> know.
>>
>> Paul
>>
>>
>
Hi Paul,

Can't see the attachment. Thks!

"PJ6" wrote:

> It's all there as an attachment in my original post. I can post in in plain
> text here if you can't see it.
> Paul
> "JJ" <JJ@.discussions.microsoft.com> wrote in message
> news:E41467C7-3AC5-404E-AB4C-B4D593648983@.microsoft.com...
> > Hi Paul,
> > Can you pass the codes to me? I am running into some troubles with Context
> > menu. I had tried the 'CuttingEdge0502' context menu which is downloadable
> > in
> > the net. I tried to add this control dynamically but it seems nothing
> > appears
> > when I activate it. Dunno how to continue. U come across this control?
> > Thanks
> > "PJ6" wrote:
> >> After a couple of months of learning ASP.NET, I think I have something
> >> worth
> >> sharing.
> >>
> >> The purpose of this example was to create a web control that would get
> >> its
> >> code fired on postback, even if had been dynamically added from code
> >> within
> >> a user event such as from a button click.
> >>
> >> If you like this idea and/or have something to add to it please let me
> >> know.
> >>
> >> Paul
> >>
> >>
> >>
>

On Mouse over , Change the value of textbox in asp.net 2.0

On Mouse Over of the Button control, I want to change the value of the textbox or Drop down list value in asp.net 2.0, How to do this ?

Suresh

Well, the mouseOver is a clientside event, and ASP.Net is Serverside... so unless you postback you cant.

You can add a ClientSide event to populate the controls, but that will be all javascript events/methods/functions


Hi:

It is a client-side issue. Try this:

<input value="hello" ID="T1" onmouseover="ChangeText('anything')"/></form>


<script type="text/javascript">
function ChangeText(s){
document.getElementById("T1").value=s;
}
</script>

You can learn more about JS here

http://www.w3schools.com/js/js_popup.asp

Regards