Thursday, March 29, 2012
Newbie: How do I create Dynamic instrument widgets in ASP.NET
I want to create a dynamic web page, which presents various instrument
widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
browser, with continous data updates from Server side data. Obviously
these instruments need to be constantly refreshed (every 0.5 second or
so) and not just on page load.
With Windows Forms, and GDI I can do this with networked Thick Client
code. I can also do dynamic web instruments with Java Applets, and I
guess DHTML/Javascript. But I really want to do the instruments in C#
and .NET. But I don't think that I can achieve this, because http and
ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
upon Server side controls, that won't refresh my instruments with live
data, once the page is downloaded. (Traditional DHTML/Javascript looks
like a real pain to develop instruments in.)
I am agreat fan of .NET technologies, but I was hoping for better MS
and .NET support for these instrument based web applications. But I
guess my only real choice is Java Applets !
Any suggestions on how I can achieve dynamic web instruments with .NET
technology would be appreciated.
Thanks
JulesThere may well be other ways of acheiving this kind of thing, but you could
just refresh the image (in JS) representing the clock
or you could use the WebBehaviour stuff, this will allow you to connect to a
webservice on the server (using JS again) then you can update your clock or
gauge or whatever in the JS on the client.
"Jules" <Roseanna80@.hotmail.com> wrote in message
news:80bc211e.0503310335.15a8c492@.posting.google.com...
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
I'd say your requirements don't lend themselves to building a browser based
application. Consider building a traditional fat client app using ClickOnce
or NoTouch Deployment. A java applet is really no different.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
>
Newbie: How do I create Dynamic instrument widgets in ASP.NET
I want to create a dynamic web page, which presents various instrument
widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
browser, with continous data updates from Server side data. Obviously
these instruments need to be constantly refreshed (every 0.5 second or
so) and not just on page load.
With Windows Forms, and GDI I can do this with networked Thick Client
code. I can also do dynamic web instruments with Java Applets, and I
guess DHTML/Javascript. But I really want to do the instruments in C#
and .NET. But I don't think that I can achieve this, because http and
ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
upon Server side controls, that won't refresh my instruments with live
data, once the page is downloaded. (Traditional DHTML/Javascript looks
like a real pain to develop instruments in.)
I am agreat fan of .NET technologies, but I was hoping for better MS
and .NET support for these instrument based web applications. But I
guess my only real choice is Java Applets !
Any suggestions on how I can achieve dynamic web instruments with .NET
technology would be appreciated.
Thanks
JulesThere may well be other ways of acheiving this kind of thing, but you could
just refresh the image (in JS) representing the clock
or you could use the WebBehaviour stuff, this will allow you to connect to a
webservice on the server (using JS again) then you can update your clock or
gauge or whatever in the JS on the client.
"Jules" <Roseanna80@.hotmail.com> wrote in message
news:80bc211e.0503310335.15a8c492@.posting.google.c om...
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
I'd say your requirements don't lend themselves to building a browser based
application. Consider building a traditional fat client app using ClickOnce
or NoTouch Deployment. A java applet is really no different.
-Brock
DevelopMentor
http://staff.develop.com/ballen
> Hello,
> I want to create a dynamic web page, which presents various instrument
> widgets (Temperatures, pressures, rpm gauges, speeds etc.) in a
> browser, with continous data updates from Server side data. Obviously
> these instruments need to be constantly refreshed (every 0.5 second or
> so) and not just on page load.
> With Windows Forms, and GDI I can do this with networked Thick Client
> code. I can also do dynamic web instruments with Java Applets, and I
> guess DHTML/Javascript. But I really want to do the instruments in C#
> and .NET. But I don't think that I can achieve this, because http and
> ASP.NET is based upon a page based paradigm. The new ASP.NEt is based
> upon Server side controls, that won't refresh my instruments with live
> data, once the page is downloaded. (Traditional DHTML/Javascript looks
> like a real pain to develop instruments in.)
> I am agreat fan of .NET technologies, but I was hoping for better MS
> and .NET support for these instrument based web applications. But I
> guess my only real choice is Java Applets !
> Any suggestions on how I can achieve dynamic web instruments with .NET
> technology would be appreciated.
> Thanks
> Jules
newbie: how to print stuff at the shell using C# while at programming in asp.net
I want to able to see the certain value within the code itself. And I'm unable to use asp:label control.
Is there's any way I can print stuff on the shell so I can keep track of where I'm at with my varable?
I tried Console.Write(temp); but it didn't seem to work :(
TIA
Use one of the System.Diagnostics.Debug.Writexxx() methods. These will appear in the Output Window in Visual Studio as you run the site under the debugger.
Alternatively, use the HttpContext.Current.Trace.Write() method, and this will put output into the ASP.NET Trace, which you can either see on the page or via the trace.axd handler.
Thank you very much DMW, System.Diagnostics.Debug.Writexxx() is useful
case close
Newbie: How to upload and save images using ASP.NET web forms (C#)
I need to upload images in my web application using ASP.NET web forms
(written in C#). Since i have never done this before, i am unsure what is the
best method.
I assume there are two options:
1). Upload the images and save the files directory to the windows file
system. However, i assume this poses a security risk, as the file directory
will require write permissions.
2). Save the images (as objects?) in the SQL SERVER database.
Can anyone suggest the best way to do this? And, if possible, point me to
some sample code or artciles which explain how to do this.
Thanks!Charlie,
check out the following article:
http://www.codeproject.com/aspnet/fileupload.asp
I prefer to save files in the database but it depends on your needs.
If you need to save hundred thousands of files and decide that you want to
save them on your hard disk make sure to distribute them on different
directories. What you could do is that you assign a guid to each file and
create your directory structure accordingly.
Example:
You have five files with the following guids
0A59E8D6-0AE5-475B-8698-814C2C712029
F16CE1B1-56D0-42E6-9463-A58D553CC289
D90C27C7 -8BD9-4F47-8CFE-DE9D240AD136
370B6080-DF06-4DDE-BB5E-85264B8AE48B
861DC387-FDC7-4A4F-B0C3-9EA6734A562A
You could now create a directory like the following:
0A59E8D6\0AE5\475B\8698\814C2C712029
F16CE1B1\56D0\42E6\9463\A58D553CC289
D90C27C7 \8BD9\4F47\8CFE\DE9D240AD136
370B6080\DF06\4DDE\BB5E\85264B8AE48B
861DC387\FDC7\4A4F\B0C3\9EA6734A562A
HTHs
Daniel
"charliewest" <charliewest@.discussions.microsoft.com> schrieb im Newsbeitrag
news:E6DD7087-DC4F-4E78-9741-0EF7F76883B6@.microsoft.com...
> Hello -
> I need to upload images in my web application using ASP.NET web forms
> (written in C#). Since i have never done this before, i am unsure what is
> the
> best method.
> I assume there are two options:
> 1). Upload the images and save the files directory to the windows file
> system. However, i assume this poses a security risk, as the file
> directory
> will require write permissions.
> 2). Save the images (as objects?) in the SQL SERVER database.
> Can anyone suggest the best way to do this? And, if possible, point me to
> some sample code or artciles which explain how to do this.
> Thanks!
newbie: I wonder if this is possible in asp.net 2.0
asp.net 2.0
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
Best RegardsThis article should help, and even fleshes out some of the sample code
provided by one of the MS people for it:
http://www.eggheadcafe.com/articles/20060731.asp
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Jeff" wrote:
Quote:
Originally Posted by
Hey
>
asp.net 2.0
>
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
>
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
>
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
>
Best Regards
>
>
>
newbie: I wonder if this is possible in asp.net 2.0
asp.net 2.0
As far as I know it's possible to search the users registrered at a asp.net
2.0 web portal using either username or e-mail.
But what about the custom profile properties which can be configured in
web.config? Can they be searched too? I guess it can by using foreach loop
and test the contents on every user object.. but I thought maybe there was a
cleaner and faster way to do it...
Lets say for example these are custom profile settings in web.config. any
suggestion on how to search them? Lets say the search should return all
users containing the phrase "Lets" in lastname? or all users of a specific
gender?
<profile enabled="true">
<properties>
<add name="FirstName" type="string"/>
<add name="LastName" type="string"/>
<add name="Gender" type="string"/>
<add name="BirthDate" type="DateTime"/>
</properties>
</profile>
Best RegardsThis article should help, and even fleshes out some of the sample code
provided by one of the MS people for it:
http://www.eggheadcafe.com/articles/20060731.asp
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Jeff" wrote:
> Hey
> asp.net 2.0
> As far as I know it's possible to search the users registrered at a asp.ne
t
> 2.0 web portal using either username or e-mail.
> But what about the custom profile properties which can be configured in
> web.config? Can they be searched too? I guess it can by using foreach loop
> and test the contents on every user object.. but I thought maybe there was
a
> cleaner and faster way to do it...
> Lets say for example these are custom profile settings in web.config. any
> suggestion on how to search them? Lets say the search should return all
> users containing the phrase "Lets" in lastname? or all users of a specific
> gender?
> <profile enabled="true">
> <properties>
> <add name="FirstName" type="string"/>
> <add name="LastName" type="string"/>
> <add name="Gender" type="string"/>
> <add name="BirthDate" type="DateTime"/>
> </properties>
> </profile>
> Best Regards
>
>
Monday, March 26, 2012
Newbie: Page level caching in ASP.NET
How could Page level caching be implemented in ASP.NET ? My ASP.NET page
takes some query arguments and I want page level cache to last for the
lifetime of the page generated using the passed arguments only. If different
arguments are passed, I want new page level cache for the new page. Is it as
simple as adding page level variables ? Note page may query data
asynchronously using AJAX also. Does it change things ?
Thanks and regards
NavinAjax shouldn't screw around with anything.
To cache different versions based on querystring values, use the VaryByParam
attribute of the OutputCache control
<%@. OutputCache Duration="3600" VaryByParam="id" %>
assuming "id" is the querystring you want to create a different cache on.
Take a look at:
http://samples.gotdotnet.com/quicks...putcaching.aspx
Karl
MY ASP.Net tutorials
http://www.openmymind.net/
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:uQ6LgmEAGHA.916@.TK2MSFTNGP10.phx.gbl...
> Hi,
> How could Page level caching be implemented in ASP.NET ? My ASP.NET page
> takes some query arguments and I want page level cache to last for the
> lifetime of the page generated using the passed arguments only. If
> different
> arguments are passed, I want new page level cache for the new page. Is it
> as
> simple as adding page level variables ? Note page may query data
> asynchronously using AJAX also. Does it change things ?
> Thanks and regards
> Navin
>
Thanks. My qyery string is long passing a bunch of arguments. Would it work
for a combination of query string arguments ? Is there a limit ? I also
wanted simple caching while generated page is active and, to use the cache,
when an action is performed on the page. When page is destroyed, I want to
clear THAT page level cache. Would simple page level variables do that are
garbage collected when Page object is destroyed after ASP.NET page request
completes ?
Thanks again and regards
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:uwpW89EAGHA.1256@.TK2MSFTNGP15.phx.gbl...
> Ajax shouldn't screw around with anything.
> To cache different versions based on querystring values, use the
VaryByParam
> attribute of the OutputCache control
> <%@. OutputCache Duration="3600" VaryByParam="id" %>
> assuming "id" is the querystring you want to create a different cache on.
> Take a look at:
> http://samples.gotdotnet.com/quicks...putcaching.aspx
> Karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Navin Mishra" <navin.mishra@.siemens.com> wrote in message
> news:uQ6LgmEAGHA.916@.TK2MSFTNGP10.phx.gbl...
page
it
>
Comments appreciated! Is it possible ?
Thanks in advance and regards
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:%231jq8DLAGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Thanks. My qyery string is long passing a bunch of arguments. Would it
work
> for a combination of query string arguments ? Is there a limit ? I also
> wanted simple caching while generated page is active and, to use the
cache,
> when an action is performed on the page. When page is destroyed, I want to
> clear THAT page level cache. Would simple page level variables do that are
> garbage collected when Page object is destroyed after ASP.NET page request
> completes ?
> Thanks again and regards
> "Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
> wrote in message news:uwpW89EAGHA.1256@.TK2MSFTNGP15.phx.gbl...
> VaryByParam
on.
> page
> it
>
newbie: preparing ASP.NET application for release
in a release format.
I just want to be sure of a few things first:
- I take it that I only need to upload the aspx files, the bin directory
files, stylesheets, global.asax and web.config onto the server?
(i.e. I don't need to upload the .vb source files and assemblynfo.vb,
etc?)
- Also, to prepare the application for release mode, do I just need to
set the <compilation> tag to debug="false" ?
Anything else I should know about?
Thanks,
Peter
--
"I hear ma train a comin'
... hear freedom comin"debug="false" compile the code i release mode (assuming you are using
VS.Net, that's just a dropdown that says DEBUG and RELEASE). you also need
ascx (user controls), asmx (web services), asax (global)
you can remove the vbproj and sln/suo files.
karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Stimp" <ren@.spumco.com> wrote in message
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
> I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
To depoly the project to the server you can use the copy project function in
the project menu (if you are using Visual Studio). Just check, copy "Only
files needed to run this application". You must have your ASP.NET project
selected in the solution explorer.
/Henke
"Stimp" <ren@.spumco.com> skrev i meddelandet
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
>I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
... in addition to what guys suggested check out this:
http://msdn.microsoft.com/library/d.../CL_SecuAsp.asp
Pay attention to web.config settings, especially if your app is hosted on
shared server (hosting company or several apps on one server)
"Stimp" <ren@.spumco.com> wrote in message
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
>I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
newbie: preparing ASP.NET application for release
in a release format.
I just want to be sure of a few things first:
- I take it that I only need to upload the aspx files, the bin directory
files, stylesheets, global.asax and web.config onto the server?
(i.e. I don't need to upload the .vb source files and assemblynfo.vb,
etc?)
- Also, to prepare the application for release mode, do I just need to
set the <compilation> tag to debug="false" ?
Anything else I should know about?
Thanks,
Peter
--
"I hear ma train a comin'
... hear freedom comin"debug="false" compile the code i release mode (assuming you are using
VS.Net, that's just a dropdown that says DEBUG and RELEASE). you also need
ascx (user controls), asmx (web services), asax (global)
you can remove the vbproj and sln/suo files.
karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Stimp" <ren@.spumco.com> wrote in message
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
> I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
To depoly the project to the server you can use the copy project function in
the project menu (if you are using Visual Studio). Just check, copy "Only
files needed to run this application". You must have your ASP.NET project
selected in the solution explorer.
/Henke
"Stimp" <ren@.spumco.com> skrev i meddelandet
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
>I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
... in addition to what guys suggested check out this:
http://msdn.microsoft.com/library/d.../>
SecuAsp.asp
Pay attention to web.config settings, especially if your app is hosted on
shared server (hosting company or several apps on one server)
"Stimp" <ren@.spumco.com> wrote in message
news:slrncphetf.sp2.ren@.carbon.redbrick.dcu.ie...
>I have an ASP.NET application that I'm ready to upload onto a webserver
> in a release format.
> I just want to be sure of a few things first:
> - I take it that I only need to upload the aspx files, the bin directory
> files, stylesheets, global.asax and web.config onto the server?
> (i.e. I don't need to upload the .vb source files and assemblynfo.vb,
> etc?)
> - Also, to prepare the application for release mode, do I just need to
> set the <compilation> tag to debug="false" ?
> Anything else I should know about?
> Thanks,
> Peter
> --
> "I hear ma train a comin'
> ... hear freedom comin"
newbie: Problems creating asp.net 2.0 Menu
ASP.NET 2.0
On my web page I got 2 menu controls: menu A is a horizontal menu displaying
menuitems at the top level. Menu B displays the submenuitems related to what
is selected in menu A. Menu A and Menu B are using the same sitemap
provider.. This works fine today.
But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I also
want it show some other submenuitems which isn't affect by what is selected
in menu A
Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F
In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...
Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />
I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A
Best Regards
JeffLook at the bottom
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...
Quote:
Originally Posted by
Hey
>
ASP.NET 2.0
>
On my web page I got 2 menu controls: menu A is a horizontal menu
displaying menuitems at the top level. Menu B displays the submenuitems
related to what is selected in menu A. Menu A and Menu B are using the
same sitemap provider.. This works fine today.
>
But now I want to improve this a bit:
I still want menu B to show submenuitems related to menu A.. but now I
also want it show some other submenuitems which isn't affect by what is
selected in menu A
>
Example:
SideMenu
Item A
Item B
Item C
SideMenu B
Item D
Item E
Item F
>
In the example above SideMenu is related to what select in menu A, but
SideMenu B and it's submenuitems isn't related to menu A...
>
Here is the content of a sitemap file from my project:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="">
<siteMapNode url="#" title="Main Menu A" description="" >
<siteMapNode url="#" title="Sub Menu 1" description="" />
<siteMapNode url="#" title="Sub Menu 2" description="" />
</siteMapNode>
<siteMapNode url="#" title="Main Menu B" description="" >
<siteMapNode url="#" title="Sub Menu 3" description="" />
<siteMapNode url="#" title="Sub Menu 4" description="" />
</siteMapNode>
</siteMapNode>
</siteMap>
>
This is the menu B markup in my web page:
<asp:Menu ID="mnuHeader"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Horizontal"
StaticDisplayLevels="2"
OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
StaticMenuItemStyle-CssClass="MainMenu"
StaticHoverStyle-CssClass="MainMenu:hover" />
<asp:SiteMapDataSource ID="smdsHeader" runat="server"
SiteMapProvider="Members" />
>
I'm wondering about how to configure (both in .sitemap file and in markup)
these additional submenu items so they are not related to what is selected
in menu A
>
Best Regards
>
Jeff
>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
I still wondering how to solve this
Jeff
I've solved this by using 2 menu controls
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...
Quote:
Originally Posted by
>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>
>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>
I didn't find a solution so I had to use a workaround. Using 2 menu controls
instead of only 1
So I consider this thread for solved
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:OP2bkFfTHHA.996@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Look at the bottom
>
"Jeff" <it_consultant1@.hotmail.com.NOSPAMwrote in message
news:u7hIvCfTHHA.4668@.TK2MSFTNGP04.phx.gbl...
Quote:
Originally Posted by
>Hey
>>
>ASP.NET 2.0
>>
>On my web page I got 2 menu controls: menu A is a horizontal menu
>displaying menuitems at the top level. Menu B displays the submenuitems
>related to what is selected in menu A. Menu A and Menu B are using the
>same sitemap provider.. This works fine today.
>>
>But now I want to improve this a bit:
>I still want menu B to show submenuitems related to menu A.. but now I
>also want it show some other submenuitems which isn't affect by what is
>selected in menu A
>>
>Example:
>SideMenu
> Item A
> Item B
> Item C
>SideMenu B
> Item D
> Item E
> Item F
>>
>In the example above SideMenu is related to what select in menu A, but
>SideMenu B and it's submenuitems isn't related to menu A...
>>
>Here is the content of a sitemap file from my project:
><?xml version="1.0" encoding="utf-8" ?>
><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
> <siteMapNode url="Default.aspx" title="Home" description="">
> <siteMapNode url="#" title="Main Menu A" description="" >
> <siteMapNode url="#" title="Sub Menu 1" description="" />
> <siteMapNode url="#" title="Sub Menu 2" description="" />
> </siteMapNode>
> <siteMapNode url="#" title="Main Menu B" description="" >
> <siteMapNode url="#" title="Sub Menu 3" description="" />
> <siteMapNode url="#" title="Sub Menu 4" description="" />
> </siteMapNode>
> </siteMapNode>
></siteMap>
>>
>This is the menu B markup in my web page:
><asp:Menu ID="mnuHeader"
> runat="server"
> DataSourceID="smdsHeader"
> MaximumDynamicDisplayLevels="0"
> Orientation="Horizontal"
> StaticDisplayLevels="2"
> OnMenuItemDataBound="mnuHeader_MenuItemDataBound"
> StaticMenuItemStyle-CssClass="MainMenu"
> StaticHoverStyle-CssClass="MainMenu:hover" />
><asp:SiteMapDataSource ID="smdsHeader" runat="server"
>SiteMapProvider="Members" />
>>
>I'm wondering about how to configure (both in .sitemap file and in
>markup) these additional submenu items so they are not related to what is
>selected in menu A
>>
>Best Regards
>>
>Jeff
>>
>
the menu markup I posted in my previous post is NOT for menu B it is for
menu A
>
Here is the markup of menu B:
<asp:Menu ID="mnuSidemenu"
runat="server"
DataSourceID="smdsHeader"
MaximumDynamicDisplayLevels="0"
Orientation="Vertical"
StaticDisplayLevels="2"
StaticMenuItemStyle-CssClass="menuitem"
StaticHoverStyle-CssClass="menuitem:hover"
OnMenuItemDataBound="mnuSidebar_MenuItemDataBound" >
</asp:Menu>
>
I still wondering how to solve this
>
Jeff
>
Saturday, March 24, 2012
Newbie: Upload large file from client to server in ASP.NET
odd requirements. I need to develop an ASP app that will upload a
large file (200 MB+) to a server without any user interaction, meaning
I can's simply put a file input box on the page and let the user
choose the file. I basically need them to click a button and have the
file transferred. I know that this would be a dangerous practice if
anyone could do it, but is it possible in a controlled environment?
Because of the size of the file I have been looking at FTPing it, but
can't figure out how to get client script to start the FTP. I have
also found this code (below) that utilizes a web service, but I don't
see how the client-script would get the file from the client since it
appears to be ASP. Any ideas for this situation would be MUCH
appreciated.
<WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
FlNameAsString)AsString
Try
Dim m As New MemoryStream(fs)
Dim f As New FileStream("c:\tempUploaded\" & FlName,
FileMode.Create)
m.WriteTo(f)
m.Close()
f.Close()
f = Nothing
m = Nothing
Return "File Uploaded"
Catch ex As Exception
Return ex.Message
End Try
End Function
The UploadFile Webmethod accepts a byte array and the name of the
file, the byte array is copied to a memory stream which is written to
a FileStream.
The client code to upload a file,
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Try
Dim f As System.IO.File
Dim fs As System.IO.FileStream
Dim o As New localhost.Service1()
'file to upload
fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
Dim b(fs.Length - 1) As Byte
fs.Read(b, 0, fs.Length)
MsgBox(o.UploadFile(b, "upload.pdf"))
f = Nothing
fs.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End SubYou can use the HTTP classes to write an upload client as a Winexe, there
are examples in the SDK of how to do this using the webclient uploadfile
method, as shown here.
Console.Write("\nPlease enter the URL to post data to : ");
String uriString = Console.ReadLine();
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
Console.WriteLine("\nPlease enter the fully qualified path of the
file to be uploaded to the URL");
string fileName = Console.ReadLine();
Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);
// Upload the file to the URL using the HTTP 1.0 POST.
byte[] responseArray =
myWebClient.UploadFile(uriString,"POST",fileName);
// Decode and display the response.
Console.WriteLine("\nResponse Received.The contents of the file
uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
You then need to control your server side timouts, and set your
machine.config settings to control the ma file size permitted for uplaods
(look it up - cant recall all the settings)
If you want to resort to FTP, then you can easily script the FTP.EXE that
comes with windows with the /s flag.
--
Regards
John Timney (Microsoft ASP.NET MVP)
--------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
--------------
"Greg" <greg_leflar@.hotmail.com> wrote in message
news:1651b2f9.0308171354.6c1ee8ae@.posting.google.c om...
> I have seen many posts for this same subject, but my project has some
> odd requirements. I need to develop an ASP app that will upload a
> large file (200 MB+) to a server without any user interaction, meaning
> I can's simply put a file input box on the page and let the user
> choose the file. I basically need them to click a button and have the
> file transferred. I know that this would be a dangerous practice if
> anyone could do it, but is it possible in a controlled environment?
> Because of the size of the file I have been looking at FTPing it, but
> can't figure out how to get client script to start the FTP. I have
> also found this code (below) that utilizes a web service, but I don't
> see how the client-script would get the file from the client since it
> appears to be ASP. Any ideas for this situation would be MUCH
> appreciated.
> <WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
> FlNameAsString)AsString
> Try
> Dim m As New MemoryStream(fs)
> Dim f As New FileStream("c:\tempUploaded\" & FlName,
> FileMode.Create)
> m.WriteTo(f)
> m.Close()
> f.Close()
> f = Nothing
> m = Nothing
> Return "File Uploaded"
> Catch ex As Exception
> Return ex.Message
> End Try
> End Function
> The UploadFile Webmethod accepts a byte array and the name of the
> file, the byte array is copied to a memory stream which is written to
> a FileStream.
> The client code to upload a file,
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
> Try
> Dim f As System.IO.File
> Dim fs As System.IO.FileStream
> Dim o As New localhost.Service1()
> 'file to upload
> fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
> Dim b(fs.Length - 1) As Byte
> fs.Read(b, 0, fs.Length)
> MsgBox(o.UploadFile(b, "upload.pdf"))
> f = Nothing
> fs.Close()
> Catch ex As Exception
> MsgBox(ex.Message)
> End Try
> End Sub
Thank you for your reply. Your code sample makes sense. How would I
then execute that script on the client from an aspx? Again, I don't
know if this is even possible because of the devious implications, but
the client is on our LAN so I have complete control.
"John Timney \(Microsoft MVP\)" <timneyj@.despammed.com> wrote in message news:<OT1XywQZDHA.2668@.TK2MSFTNGP09.phx.gbl>...
> You can use the HTTP classes to write an upload client as a Winexe, there
> are examples in the SDK of how to do this using the webclient uploadfile
> method, as shown here.
> Console.Write("\nPlease enter the URL to post data to : ");
> String uriString = Console.ReadLine();
> // Create a new WebClient instance.
> WebClient myWebClient = new WebClient();
> Console.WriteLine("\nPlease enter the fully qualified path of the
> file to be uploaded to the URL");
> string fileName = Console.ReadLine();
> Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);
> // Upload the file to the URL using the HTTP 1.0 POST.
> byte[] responseArray =
> myWebClient.UploadFile(uriString,"POST",fileName);
> // Decode and display the response.
> Console.WriteLine("\nResponse Received.The contents of the file
> uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
> You then need to control your server side timouts, and set your
> machine.config settings to control the ma file size permitted for uplaods
> (look it up - cant recall all the settings)
> If you want to resort to FTP, then you can easily script the FTP.EXE that
> comes with windows with the /s flag.
> --
> Regards
> John Timney (Microsoft ASP.NET MVP)
> --------------
> <shameless_author_plug>
> Professional .NET for Java Developers with C#
> ISBN:1-861007-91-4
> Professional Windows Forms
> ISBN: 1861005547
> Professional JSP 2nd Edition
> ISBN: 1861004958
> Professional JSP
> ISBN: 1861003625
> Beginning JSP Web Development
> ISBN: 1861002092
> </shameless_author_plug>
> --------------
> "Greg" <greg_leflar@.hotmail.com> wrote in message
> news:1651b2f9.0308171354.6c1ee8ae@.posting.google.c om...
> > I have seen many posts for this same subject, but my project has some
> > odd requirements. I need to develop an ASP app that will upload a
> > large file (200 MB+) to a server without any user interaction, meaning
> > I can's simply put a file input box on the page and let the user
> > choose the file. I basically need them to click a button and have the
> > file transferred. I know that this would be a dangerous practice if
> > anyone could do it, but is it possible in a controlled environment?
> > Because of the size of the file I have been looking at FTPing it, but
> > can't figure out how to get client script to start the FTP. I have
> > also found this code (below) that utilizes a web service, but I don't
> > see how the client-script would get the file from the client since it
> > appears to be ASP. Any ideas for this situation would be MUCH
> > appreciated.
> > <WebMethod()> PublicFunction UploadFile(ByVal fs()AsByte,ByVal
> > FlNameAsString)AsString
> > Try
> > Dim m As New MemoryStream(fs)
> > Dim f As New FileStream("c:\tempUploaded\" & FlName,
> > FileMode.Create)
> > m.WriteTo(f)
> > m.Close()
> > f.Close()
> > f = Nothing
> > m = Nothing
> > Return "File Uploaded"
> > Catch ex As Exception
> > Return ex.Message
> > End Try
> > End Function
> > The UploadFile Webmethod accepts a byte array and the name of the
> > file, the byte array is copied to a memory stream which is written to
> > a FileStream.
> > The client code to upload a file,
> > Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles Button1.Click
> > Try
> > Dim f As System.IO.File
> > Dim fs As System.IO.FileStream
> > Dim o As New localhost.Service1()
> > 'file to upload
> > fs = f.Open("c:\upload.pdf", IO.FileMode.Open, IO.FileAccess.Read)
> > Dim b(fs.Length - 1) As Byte
> > fs.Read(b, 0, fs.Length)
> > MsgBox(o.UploadFile(b, "upload.pdf"))
> > f = Nothing
> > fs.Close()
> > Catch ex As Exception
> > MsgBox(ex.Message)
> > End Try
> > End Sub
Newbie: using asp.net 2.0 profile in an ASP.NET web service
Is it possible to use asp.net 2.0 profile in an ASP.NET web service ? I
want to authenticate a user via the web service and store user profile data
using ASP.NET 2.0 profile ? Is it possible at all ?
Thanks in advance and regards
NavinYes, it is possible. You hook the app up to the profile provider and then
add info from the service using the membership and/or profile bits. The main
difference is you generally do not want to hold session in web services like
you might in a web application.
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
****************************************
*********
Think outside of the box!
****************************************
*********
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:Ojk2tqr5GHA.2208@.TK2MSFTNGP04.phx.gbl...
> Hi,
> Is it possible to use asp.net 2.0 profile in an ASP.NET web service ? I
> want to authenticate a user via the web service and store user profile
> data using ASP.NET 2.0 profile ? Is it possible at all ?
> Thanks in advance and regards
> Navin
>
Some sample code would help. In a web service, the profile keys added don't
appear as properties of Profile object but in an ASP.NET web app they do.
Thanks in advance and regards
Navin
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
message news:%23yx0S9u5GHA.2044@.TK2MSFTNGP02.phx.gbl...
> Yes, it is possible. You hook the app up to the profile provider and then
> add info from the service using the membership and/or profile bits. The
> main difference is you generally do not want to hold session in web
> services like you might in a web application.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
> ****************************************
*********
> Think outside of the box!
> ****************************************
*********
> "Navin Mishra" <navin.mishra@.siemens.com> wrote in message
> news:Ojk2tqr5GHA.2208@.TK2MSFTNGP04.phx.gbl...
>
Any sample code would really help...thanks in advance!
Navin
"Navin Mishra" <navin.mishra@.siemens.com> wrote in message
news:OGtvjBv5GHA.2044@.TK2MSFTNGP02.phx.gbl...
> Some sample code would help. In a web service, the profile keys added
> don't appear as properties of Profile object but in an ASP.NET web app
> they do.
> Thanks in advance and regards
> Navin
> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@.comcast.netNoSpamM> wrote in
> message news:%23yx0S9u5GHA.2044@.TK2MSFTNGP02.phx.gbl...
>
I am having a problem with this as well
What I am trying to do is to have a textbox that a user begins to type what
he is searching for.
I am using an AutoCompleteExtender to call a method in the web service that
queries the database for the field description and pull "like" results.
The problem is that I already have a profile that handles the users profile,
but I need to add another profile for the property dragOverlayPosition.
Here is my web.config: (sorry its long)
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<!--
The configSections define a section for ASP.NET Atlas.
-->
<configSections>
<sectionGroup name="microsoft.web"
type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup">
<section name="converters"
type="Microsoft.Web.Configuration.ConvertersSection"
requirePermission="false"/>
<section name="webServices"
type="Microsoft.Web.Configuration.WebServicesSection"
requirePermission="false"/>
<section name="authenticationService"
type="Microsoft.Web.Configuration.AuthenticationServiceSection"
requirePermission="false"/>
<section name="profileService"
type="Microsoft.Web.Configuration.ProfileServiceSection"
requirePermission="false"/>
</sectionGroup>
</configSections>
<!--
The microsoft.web section defines items required for the Atlas
framework.
-->
<microsoft.web>
<converters>
<add
type="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/>
<add
type="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/>
<add
type="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/>
</converters>
<webServices enableBrowserAccess="true"/>
<authenticationService enabled="true"/>
<!-- The example application needs the profileService to be enabled and to
specify the dragOverlayPosition property. -->
<profileService enabled="true" setProperties="dragOverlayPosition"
getProperties="dragOverlayPosition"/>
</microsoft.web>
<appSettings>
<add key="Online" value="1"/>
<add key="ReBidLimit" value="20"/>
</appSettings>
<connectionStrings
configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>AQAAANCMnd8BFdERjHoAwE/ Cl+sBAAAAm9HBmMaT0ka0sma3lHvjeQQAAAACAAA
AAAADZgAAqAAAABAAAADICZdWipnIOoLmIKm/TFfGAAAAAASAAACgAAAAEAAAAIWa0+YCYQK2yoM
XgXduY6v4AQAABee1Y7Uz9xTwwYaZwZGk0FE+EfK
5w6O6ZjbZmAqDdOgXMk6st1S7ZRHmKRcKXIX
Iht6p7nMWkbnm1S7duVu4/sAEfG
Dy0S5OgRqr8v2cwZ8VnSe1Yxuoadw58e9+Nid1TW
Fu0amasyFKXUMJt5WhOs36a6N5mKXndYwWv8
JKewH4uhRR52aItD64/ iNYNC3fXnA0tbIA08PtPBazyFeXNlgMlQ68llwdd
mE9cizXlIYzkYkyEx
vjRhbRiYXMKenkzkFXVZH0+rXyB1JMYKXKGO9516
emzk72hz88Cl2TE064i4TnkKSu9WXSiUL705
YBdbkfW53wpuaREdobq5105np40
iWP6qWdzrULx7I46VWpUcdePfEHc/ i3GgfuAW2zNIwyKA1yGRdkrWa22iL+ymdqOP+Exb
Q0vctbH
TE4AlgmaFVNqdDRCGakMX0jB/nw3S3Q9WWlV1RAWX7Uobm0SNjb7k1E8x5DRgQG/74WGcucGRVXv
GU//D+7fu776CW0crdoFC5q3tmLo7EoOFKQNkDkfqk/C7Wklh/2oBVzvTQR9Jhp0M5XUDMXmtGkw
AhsDOj/RgkqEKj5bTHb5CRrY91d
QQSYEFgJgbvuOyWYT+N2qsPldQxWOjK0GGyb8jk/mxq6i9tKBp2jKWtVaLIayfejIxY76Au6FAAA
ABq6ejD10wN+VUxBxgESIh2z4oQ+</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
<system.web>
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx"
type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
<add verb="*" path="*.asbx"
type="Microsoft.Web.Services.ScriptHandlerFactory" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="Microsoft.Web.Services.ScriptModule"/>
<add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>
<add name="WebResourceCompression"
type="Microsoft.Web.Services.WebResourceCompressionModule"/>
</httpModules>
<customErrors mode="RemoteOnly" defaultRedirect="~/Controls/Error.aspx"/>
<roleManager enabled="true" cacheRolesInCookie="true"
cookieName="gsauctionrole" defaultProvider="GSARoleProvider">
<providers>
<add connectionStringName="gsauctionsConnectionString"
applicationName="/" name="GSARoleProvider"
type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</roleManager>
<siteMap defaultProvider="GSASiteMapProvider" enabled="true">
<providers>
<add name="GSASiteMapProvider" type="System.Web.XmlSiteMapProvider"
securityTrimmingEnabled="true" siteMapFile="Web.sitemap"/>
</providers>
</siteMap>
<anonymousIdentification cookieless="AutoDetect" enabled="true"/>
<profile defaultProvider="GSA_ProfileProvider" enabled="True">
<providers>
<add name="GSA_ProfileProvider"
type="Microsoft.Samples.SqlTableProfileProvider"
connectionStringName="gsauctionsConnectionString" table="gsa_Profiles"
applicationName="/"/>
</providers>
<!-- Old Way
<providers>
<add name="GSA_ProfileProvider"
connectionStringName="gsauctionsConnectionString"
applicationName="/"
type="System.Web.Profile.SqlProfileProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
-->
<properties>
<add name="Email" type="String" defaultValue="[null]"
customProviderData="Email;nvarchar"/>
<add name="UserName" type="String" defaultValue="[null]"
customProviderData="UserName;nvarchar"/>
<add name="FirstName" type="String" defaultValue="[null]"
customProviderData="FirstName;nvarchar"/>
<add name="LastName" type="String" defaultValue="[null]"
customProviderData="LastName;nvarchar"/>
<add name="Organ" type="String" defaultValue="[null]"
customProviderData="Organ;nvarchar"/>
<add name="Dept" type="String" defaultValue="[null]"
customProviderData="Dept;nvarchar"/>
<add name="JobTitle" type="String" defaultValue="[null]"
customProviderData="JobTitle;nvarchar"/>
<add name="TaxEmp" type="String" defaultValue="[null]"
customProviderData="TaxEmp;nvarchar"/>
<add name="NonPro" type="String" defaultValue="[null]"
customProviderData="NonPro;nvarchar"/>
<add name="Street1" type="String" defaultValue="[null]"
customProviderData="Street1;nvarchar"/>
<add name="Street2" type="String" defaultValue="[null]"
customProviderData="Street2;nvarchar"/>
<add name="PostalCode" type="String" defaultValue="[null]"
customProviderData="PostalCode;nvarchar"/>
<add name="City" type="String" defaultValue="[null]"
customProviderData="City;nvarchar"/>
<add name="State" type="String" defaultValue="[null]"
customProviderData="State;nvarchar"/>
<add name="Country" type="String" defaultValue="[null]"
customProviderData="Country;nvarchar"/>
<add name="TPh1" type="String" defaultValue="[null]"
customProviderData="TPh1;nvarchar"/>
<add name="TPh2" type="String" defaultValue="[null]"
customProviderData="TPh2;nvarchar"/>
<add name="CPh1" type="String" defaultValue="[null]"
customProviderData="CPh1;nvarchar"/>
<add name="CPh2" type="String" defaultValue="[null]"
customProviderData="CPh2;nvarchar"/>
<add name="Fax1" type="String" defaultValue="[null]"
customProviderData="Fax1;nvarchar"/>
<add name="Fax2" type="String" defaultValue="[null]"
customProviderData="Fax2;nvarchar"/>
</properties>
</profile>
<!-- Hide those ugly URLs -->
<urlMappings>
<add url="~/Default.aspx?pg=admin" mappedUrl="~/Admin/Default.aspx"/>
<add url="~/Default.aspx?pg=musr" mappedUrl="~/Admin/ManageUsers.aspx"/>
<add url="~/Default.aspx?pg=mcat" mappedUrl="~/Admin/ManageAssets.aspx"/>
<add url="~/Default.aspx?pg=mbid" mappedUrl="~/Admin/ManageAuctions.aspx"/>
<add url="~/Default.aspx?pg=fpwd" mappedUrl="~/Users/Forgotpwd.aspx"/>
<add url="~/Default.aspx?pg=login" mappedUrl="~/Users/Login.aspx"/>
<add url="~/Default.aspx?pg=mpro" mappedUrl="~/Users/MyProfile.aspx"/>
<add url="~/Default.aspx?pg=reset" mappedUrl="~/Users/ResetPwd.aspx"/>
<add url="~/Default.aspx?pg=reg" mappedUrl="~/Users/Register.aspx"/>
</urlMappings>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
Visual Basic options:
Set strict="true" to disallow all data type conversions
where data loss can occur.
Set explicit="true" to force declaration of all variables.
-->
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/></assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider,
Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
<add extension=".asbx" type="Microsoft.Web.Services.BridgeBuildProvider"/>
</buildProviders>
<codeSubDirectories>
<add directoryName="CSCode"/>
<add directoryName="VBCode"/>
</codeSubDirectories>
</compilation>
<pages theme="GSAuction" masterPageFile="~/GSAuction.master">
<namespaces>
<clear/>
<add namespace="System"/>
<add namespace="System.Collections"/>
<add namespace="System.Collections.Specialized"/>
<add namespace="System.Configuration"/>
<add namespace="System.Text"/>
<add namespace="System.Text.RegularExpressions"/>
<add namespace="System.Web"/>
<add namespace="System.Web.Caching"/>
<add namespace="System.Web.SessionState"/>
<add namespace="System.Web.Security"/>
<add namespace="System.Web.Profile"/>
<add namespace="System.Web.UI"/>
<add namespace="System.Web.UI.WebControls"/>
<add namespace="System.Web.UI.WebControls.WebParts"/>
<add namespace="System.Web.UI.HtmlControls"/>
<add namespace="System.Net.Mail"/>
</namespaces>
</pages>
<!--
<authorization>
<allow users="*" />
</authorization>
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Forms">
<forms loginUrl="Default.aspx"></forms>
</authentication>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
-->
<membership defaultProvider="GSAMembershipProvider"
userIsOnlineTimeWindow="15">
<providers>
<add name="GSAMembershipProvider"
connectionStringName="gsauctionsConnectionString" applicationName="/"
requiresUniqueEmail="false" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0
,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
</system.web>
How or where do I stick this?
<!-- The SimpleList application needs profile to be enabled, and to allow
anonymous users access to the property. -->
<profile enabled="true">
<properties>
<add allowAnonymous="true" name="dragOverlayPosition" defaultValue=""
serializeAs="String"/>
</properties>
</profile>
"Cowboy (Gregory A. Beamer)" wrote:
> Yes, it is possible. You hook the app up to the profile provider and then
> add info from the service using the membership and/or profile bits. The ma
in
> difference is you generally do not want to hold session in web services li
ke
> you might in a web application.
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
> ****************************************
*********
> Think outside of the box!
> ****************************************
*********
> "Navin Mishra" <navin.mishra@.siemens.com> wrote in message
> news:Ojk2tqr5GHA.2208@.TK2MSFTNGP04.phx.gbl...
>
>
Thursday, March 22, 2012
newby Q about using Google Maps with ASP.Net 2.0
done some real basic stuff. Now I am digging into some real ASP.Net
2.0 and am totally lost some things.
I have a master page setup and that is working great. On my contact
page I would like to use Google Maps API Version 2 to show a map to my
location. Below is the first Google example.
I would like to add this to my aspx page that is using the master page.
I don't understand how to link to the google JS nor how exactly to
add the inline JS load() method to the .aspx page. Any suggestions?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="; height: 300px"></div>
</body>
</htmlCopy everthing from the "<script" to the "/script>" and paste it into the
<head> portion of the HTML in your ASP.Net page (between the "<head>" and
"</head>" tags). And do yourself a favor and learn something about HTML. All
ASP.Net does is render HTML to a browser from the server (all that you need
to know about it right now, that is). If you don't understand HTML, and then
JavaScript, you will *never* understand ASP.Net. HTML is easy. It's just a
markup language Programming is hard. Start with the easy part.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
I recycle.
I send everything back to the planet it came from.
"Sam Carleton" <scarleton@.gmail.com> wrote in message
news:1150859005.233489.315340@.i40g2000cwc.googlegr oups.com...
> Ok, over the years I have read about doing web programing and I have
> done some real basic stuff. Now I am digging into some real ASP.Net
> 2.0 and am totally lost some things.
> I have a master page setup and that is working great. On my contact
> page I would like to use Google Maps API Version 2 to show a map to my
> location. Below is the first Google example.
> I would like to add this to my aspx page that is using the master page.
> I don't understand how to link to the google JS nor how exactly to
> add the inline JS load() method to the .aspx page. Any suggestions?
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="content-type" content="text/html;
> charset=utf-8"/>
> <title>Google Maps JavaScript API Example</title>
> <script
> src="http://pics.10026.com/?src=http://maps.google.com/maps?file=api&v=2&key=abcdefg"
> type="text/javascript"></script>
> <script type="text/javascript">
> //<![CDATA[
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.setCenter(new GLatLng(37.4419, -122.1419), 13);
> }
> }
> //]]>
> </script>
> </head>
> <body onload="load()" onunload="GUnload()">
> <div id="map" style="; height: 300px"></div>
> </body>
> </html
Try using Google Maps control from this site:
http://www.reimers.dk/
Sam Carleton wrote:
> Ok, over the years I have read about doing web programing and I have
> done some real basic stuff. Now I am digging into some real ASP.Net
> 2.0 and am totally lost some things.
> I have a master page setup and that is working great. On my contact
> page I would like to use Google Maps API Version 2 to show a map to my
> location. Below is the first Google example.
> I would like to add this to my aspx page that is using the master page.
> I don't understand how to link to the google JS nor how exactly to
> add the inline JS load() method to the .aspx page. Any suggestions?
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="content-type" content="text/html;
> charset=utf-8"/>
> <title>Google Maps JavaScript API Example</title>
> <script
> src="http://pics.10026.com/?src=http://maps.google.com/maps?file=api&v=2&key=abcdefg"
> type="text/javascript"></script>
> <script type="text/javascript">
> //<![CDATA[
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.setCenter(new GLatLng(37.4419, -122.1419), 13);
> }
> }
> //]]>
> </script>
> </head>
> <body onload="load()" onunload="GUnload()">
> <div id="map" style="; height: 300px"></div>
> </body>
> </html
Kevin Spencer wrote:
> Copy everthing from the "<script" to the "/script>" and paste it into the
> <head> portion of the HTML in your ASP.Net page (between the "<head>" and
> "</head>" tags). And do yourself a favor and learn something about HTML. All
> ASP.Net does is render HTML to a browser from the server (all that you need
> to know about it right now, that is). If you don't understand HTML, and then
> JavaScript, you will *never* understand ASP.Net. HTML is easy. It's just a
> markup language Programming is hard. Start with the easy part.
Kevin,
First off, I am a professionally software developer, all my experence
is in Windows Development (C/C++/C#). I do know HTML, on a scale of 1
to 5, I would guess it is around a 3, maybe a 4. My JS skill is around
a 3. But when it comes to ASP.Net 2.0, I know it about a 1 out of 5.
That is where I am a newbe, ASP.Net 2.0.
I looked at my contact.aspx page, *which is using a master page*, and
there is not <head></head>, only the two different <asp:Contect> tags
to fill in the Content section from the Master page. I get the
impression that there is away to add the inline JS, the link to the JS
on google's web site, and the onload/onunload to the contact.aspx page,
but that it is none standard. (by the way, this is what has always
thrown me off about web development frameworks, each one does it's own
unquie thing to implement basic HTML).
Maybe there is simply a good section in the MSDN I should have alook at
that will explain this type of thing, when using master pages.
Sam
Jacob wrote:
> Try using Google Maps control from this site:
> http://www.reimers.dk/
That is great, but... I would like to *UNDERSTAND* how to do it
myself, the source code to the control at that link is not available:(
Sam
Google recommends placing the script in the head and then running it
from the body's onload event. This is done to overcome what is
generally known as the "IE Operation Aborted problem", meaning that IE
won't allow you to change the contents of a tag before it's finished
loading.
In master pages you could conceivably add the script to the head
programatically, but another solution would be to add the script
anywhere on the page and make use of the defer attribute. There is no
law of nature saying that the script has to be placed in the head.
Sam Carleton wrote:
> Kevin Spencer wrote:
> > Copy everthing from the "<script" to the "/script>" and paste it into the
> > <head> portion of the HTML in your ASP.Net page (between the "<head>" and
> > "</head>" tags). And do yourself a favor and learn something about HTML. All
> > ASP.Net does is render HTML to a browser from the server (all that you need
> > to know about it right now, that is). If you don't understand HTML, and then
> > JavaScript, you will *never* understand ASP.Net. HTML is easy. It's just a
> > markup language Programming is hard. Start with the easy part.
> Kevin,
> First off, I am a professionally software developer, all my experence
> is in Windows Development (C/C++/C#). I do know HTML, on a scale of 1
> to 5, I would guess it is around a 3, maybe a 4. My JS skill is around
> a 3. But when it comes to ASP.Net 2.0, I know it about a 1 out of 5.
> That is where I am a newbe, ASP.Net 2.0.
> I looked at my contact.aspx page, *which is using a master page*, and
> there is not <head></head>, only the two different <asp:Contect> tags
> to fill in the Content section from the Master page. I get the
> impression that there is away to add the inline JS, the link to the JS
> on google's web site, and the onload/onunload to the contact.aspx page,
> but that it is none standard. (by the way, this is what has always
> thrown me off about web development frameworks, each one does it's own
> unquie thing to implement basic HTML).
> Maybe there is simply a good section in the MSDN I should have alook at
> that will explain this type of thing, when using master pages.
> Sam
In our master page, we put a contentplaceholder tag between the HTML head
tags, then we stuff the scripts in there. Also, if you build a server
control, you can set up the scripts as a resource and override the OnLoad
like this:
protected override void OnLoad(EventArgs e)
{
Type t = this.GetType();
String js = "MyNameSpace.WebControls.MyJavaScript.js";
String url = Page.ClientScript.GetWebResourceUrl(t, js);
Page.ClientScript.RegisterClientScriptInclude(t, js, url);
base.OnLoad(e);
}
The nice thing about this is it packages it in your dll. Hope this helps.
Diane
"Sam Carleton" wrote:
Quote:
Originally Posted by
>
Jacob wrote:
Quote:
Originally Posted by
Try using Google Maps control from this site:
http://www.reimers.dk/
That is great, but... I would like to *UNDERSTAND* how to do it
myself, the source code to the control at that link is not available:(
Sam
>
newby Q about using Google Maps with ASP.Net 2.0
done some real basic stuff. Now I am digging into some real ASP.Net
2.0 and am totally lost some things.
I have a master page setup and that is working great. On my contact
page I would like to use Google Maps API Version 2 to show a map to my
location. Below is the first Google example.
I would like to add this to my aspx page that is using the master page.
I don't understand how to link to the google JS nor how exactly to
add the inline JS load() method to the .aspx page. Any suggestions?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 300px"></div>
</body>
</html>Copy everthing from the "<script" to the "/script>" and paste it into the
<head> portion of the HTML in your ASP.Net page (between the "<head>" and
"</head>" tags). And do yourself a favor and learn something about HTML. All
ASP.Net does is render HTML to a browser from the server (all that you need
to know about it right now, that is). If you don't understand HTML, and then
JavaScript, you will *never* understand ASP.Net. HTML is easy. It's just a
markup language Programming is hard. Start with the easy part.
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
I recycle.
I send everything back to the planet it came from.
"Sam Carleton" <scarleton@.gmail.com> wrote in message
news:1150859005.233489.315340@.i40g2000cwc.googlegroups.com...
> Ok, over the years I have read about doing web programing and I have
> done some real basic stuff. Now I am digging into some real ASP.Net
> 2.0 and am totally lost some things.
> I have a master page setup and that is working great. On my contact
> page I would like to use Google Maps API Version 2 to show a map to my
> location. Below is the first Google example.
> I would like to add this to my aspx page that is using the master page.
> I don't understand how to link to the google JS nor how exactly to
> add the inline JS load() method to the .aspx page. Any suggestions?
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="content-type" content="text/html;
> charset=utf-8"/>
> <title>Google Maps JavaScript API Example</title>
> <script
> src="http://pics.10026.com/?src=http://maps.google.com/maps?file=api&v=2&key=abcdefg"
> type="text/javascript"></script>
> <script type="text/javascript">
> //<![CDATA[
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.setCenter(new GLatLng(37.4419, -122.1419), 13);
> }
> }
> //]]>
> </script>
> </head>
> <body onload="load()" onunload="GUnload()">
> <div id="map" style="width: 500px; height: 300px"></div>
> </body>
> </html>
>
Try using Google Maps control from this site:
http://www.reimers.dk/
Sam Carleton wrote:
> Ok, over the years I have read about doing web programing and I have
> done some real basic stuff. Now I am digging into some real ASP.Net
> 2.0 and am totally lost some things.
> I have a master page setup and that is working great. On my contact
> page I would like to use Google Maps API Version 2 to show a map to my
> location. Below is the first Google example.
> I would like to add this to my aspx page that is using the master page.
> I don't understand how to link to the google JS nor how exactly to
> add the inline JS load() method to the .aspx page. Any suggestions?
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="content-type" content="text/html;
> charset=utf-8"/>
> <title>Google Maps JavaScript API Example</title>
> <script
> src="http://pics.10026.com/?src=http://maps.google.com/maps?file=api&v=2&key=abcdefg"
> type="text/javascript"></script>
> <script type="text/javascript">
> //<![CDATA[
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.setCenter(new GLatLng(37.4419, -122.1419), 13);
> }
> }
> //]]>
> </script>
> </head>
> <body onload="load()" onunload="GUnload()">
> <div id="map" style="width: 500px; height: 300px"></div>
> </body>
> </html>
Kevin Spencer wrote:
> Copy everthing from the "<script" to the "/script>" and paste it into the
> <head> portion of the HTML in your ASP.Net page (between the "<head>" and
> "</head>" tags). And do yourself a favor and learn something about HTML. A
ll
> ASP.Net does is render HTML to a browser from the server (all that you nee
d
> to know about it right now, that is). If you don't understand HTML, and th
en
> JavaScript, you will *never* understand ASP.Net. HTML is easy. It's just a
> markup language Programming is hard. Start with the easy part.
Kevin,
First off, I am a professionally software developer, all my experence
is in Windows Development (C/C++/C#). I do know HTML, on a scale of 1
to 5, I would guess it is around a 3, maybe a 4. My JS skill is around
a 3. But when it comes to ASP.Net 2.0, I know it about a 1 out of 5.
That is where I am a newbe, ASP.Net 2.0.
I looked at my contact.aspx page, *which is using a master page*, and
there is not <head></head>, only the two different <asp:Contect> tags
to fill in the Content section from the Master page. I get the
impression that there is away to add the inline JS, the link to the JS
on google's web site, and the onload/onunload to the contact.aspx page,
but that it is none standard. (by the way, this is what has always
thrown me off about web development frameworks, each one does it's own
unquie thing to implement basic HTML).
Maybe there is simply a good section in the MSDN I should have alook at
that will explain this type of thing, when using master pages.
Sam
Jacob wrote:
> Try using Google Maps control from this site:
> http://www.reimers.dk/
That is great, but... I would like to *UNDERSTAND* how to do it
myself, the source code to the control at that link is not available:(
Sam
Google recommends placing the script in the head and then running it
from the body's onload event. This is done to overcome what is
generally known as the "IE Operation Aborted problem", meaning that IE
won't allow you to change the contents of a tag before it's finished
loading.
In master pages you could conceivably add the script to the head
programatically, but another solution would be to add the script
anywhere on the page and make use of the defer attribute. There is no
law of nature saying that the script has to be placed in the head.
Sam Carleton wrote:
> Kevin Spencer wrote:
> Kevin,
> First off, I am a professionally software developer, all my experence
> is in Windows Development (C/C++/C#). I do know HTML, on a scale of 1
> to 5, I would guess it is around a 3, maybe a 4. My JS skill is around
> a 3. But when it comes to ASP.Net 2.0, I know it about a 1 out of 5.
> That is where I am a newbe, ASP.Net 2.0.
> I looked at my contact.aspx page, *which is using a master page*, and
> there is not <head></head>, only the two different <asp:Contect> tags
> to fill in the Content section from the Master page. I get the
> impression that there is away to add the inline JS, the link to the JS
> on google's web site, and the onload/onunload to the contact.aspx page,
> but that it is none standard. (by the way, this is what has always
> thrown me off about web development frameworks, each one does it's own
> unquie thing to implement basic HTML).
> Maybe there is simply a good section in the MSDN I should have alook at
> that will explain this type of thing, when using master pages.
> Sam
Friday, March 16, 2012
Newline detected when add script in C# (ASP.NET)
I'm trying to add script to the page and place following code in my ascx
(control):
Page.RegisterClientScriptBlock("adder", "<script>function
doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value) +
eval(document.all.TextBox2.value)}</script>");
It doesn't work giving me all kind of problems...
I suspect the problem is with <> charachters.
How do I go around this problem?
Also, placing this line in code (I use WebMatrix) will mess up all HTML
code??
Thanks!If that is the exact line from your code, then it just has to do with how
your formed your string. You cannot insert a line break in a string in C#.
It should work if you change your code to read:
Page.RegisterClientScriptBlock("adder", "<script>function " +
"doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value) +
" +
"eval(document.all.TextBox2.value)}</script>");
or, for more readability, I always for my javascript in a temp variable
first. Just kinda hard to read otherwise
string script = "<script>function " +
"doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value) +
" +
"eval(document.all.TextBox2.value)}</script>"
Page.RegisterClientScriptBlock("adder", script);
either way, both of those should work for you.
-Cliff
"Ivan Demkovitch" <i@.a.b> wrote in message
news:OfydJF8oDHA.976@.tk2msftngp13.phx.gbl...
> Hi!
> I'm trying to add script to the page and place following code in my ascx
> (control):
>
> Page.RegisterClientScriptBlock("adder", "<script>function
> doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value) +
> eval(document.all.TextBox2.value)}</script>");
> It doesn't work giving me all kind of problems...
> I suspect the problem is with <> charachters.
> How do I go around this problem?
> Also, placing this line in code (I use WebMatrix) will mess up all HTML
> code??
> Thanks!
I solved problem...
Actually the problem was in "</script>"
Changed to "<" + "/" + "script>" and it works fine now.
Thanks!
"Cliff Harris" <hersh@.myrealbox.com> wrote in message
news:OkD03L8oDHA.644@.TK2MSFTNGP11.phx.gbl...
> If that is the exact line from your code, then it just has to do with how
> your formed your string. You cannot insert a line break in a string in
C#.
> It should work if you change your code to read:
> Page.RegisterClientScriptBlock("adder", "<script>function " +
> "doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value)
+
> " +
> "eval(document.all.TextBox2.value)}</script>");
> or, for more readability, I always for my javascript in a temp variable
> first. Just kinda hard to read otherwise
> string script = "<script>function " +
> "doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value)
+
> " +
> "eval(document.all.TextBox2.value)}</script>"
> Page.RegisterClientScriptBlock("adder", script);
> either way, both of those should work for you.
> -Cliff
>
> "Ivan Demkovitch" <i@.a.b> wrote in message
> news:OfydJF8oDHA.976@.tk2msftngp13.phx.gbl...
> > Hi!
> > I'm trying to add script to the page and place following code in my ascx
> > (control):
> > Page.RegisterClientScriptBlock("adder", "<script>function
> > doadd(){document.all.TextBox3.value=eval(document. all.TextBox1.value) +
> > eval(document.all.TextBox2.value)}</script>");
> > It doesn't work giving me all kind of problems...
> > I suspect the problem is with <> charachters.
> > How do I go around this problem?
> > Also, placing this line in code (I use WebMatrix) will mess up all HTML
> > code??
> > Thanks!
Newly added asp.net webforms cannot parse
I simply try to add new default webforms to my project and none of them
can load.
Has anybody received an error like this?
Thanks,
Do
Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type 'nspi1.WebForm3'.
Source Error:
Line 1: <%@dotnet.itags.org. Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3: <html
Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
Line: 1
-----------------------
--
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573Hi,
Try to rebuild the project and re-load the page in the browser. You might be
having this error as the page class the newly added page inherits from in
its @.Page directive has not been compiled into the code-behind assembly.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Do" <doduong12141214@.hotmail.com> wrote in message
news:e%23KSrMFmDHA.2676@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I simply try to add new default webforms to my project and none of them
> can load.
> Has anybody received an error like this?
> Thanks,
> Do
> Parser Error
> Description: An error occurred during the parsing of a resource required
to
> service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: Could not load type 'nspi1.WebForm3'.
> Source Error:
> Line 1: <%@. Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
> Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> Line 3: <html>
> Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
> Line: 1
>
> -----------------------
--
> --
> Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET
> Version:1.1.4322.573
Hi,
Try to rebuild the project and re-load the page in the browser. You might be
having this error as the page class the newly added page inherits from in
its @.Page directive has not been compiled into the code-behind assembly.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"Do" <doduong12141214@.hotmail.com> wrote in message
news:e%23KSrMFmDHA.2676@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I simply try to add new default webforms to my project and none of them
> can load.
> Has anybody received an error like this?
> Thanks,
> Do
> Parser Error
> Description: An error occurred during the parsing of a resource required
to
> service this request. Please review the following specific parse error
> details and modify your source file appropriately.
> Parser Error Message: Could not load type 'nspi1.WebForm3'.
> Source Error:
> Line 1: <%@. Page Language="vb" AutoEventWireup="false"
> Codebehind="WebForm3.aspx.vb" Inherits="nspi1.WebForm3"%>
> Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> Line 3: <html>
> Source File: c:\hosting\webhost4life\member\userb\nspi1.3\WebFo rm3.aspx
> Line: 1
>
> -----------------------
--
> --
> Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET
> Version:1.1.4322.573