Saturday, March 24, 2012
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...
>
>
Newbie:please help me 'display' this on a simple .aspx page
queries from an ASP application. However I am working on a small academic
assignment and I just need to get this over with. I created the store
procedure but now the teacher didn't accept that, as he is concerned he
would need to install the store procedure in Query Analyzer from his end.
Can you please clarify how I would be to do the following using a Select
Statement (VB.NET, ASP.NET 2.0):
Dim myNextPage
myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
Dim myString
myString = "SELECT Employee From Pubs " _
& "WHERE job_id = " & TxtBox1.Text And
& "WHERE employee_name = " & TxtBox2.Text And
& "WHERE hire_date = " & TxtBox3.Text
'Now I want to:
If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
(hire_date = TxtBox3.Text) Then
Response.Redirect("myNextPage")
'Then on Next page I would like to display label.Text = "Your
information matched and I can go ahead to reset your password in AD..."
'However doing:
label.Text = "Your info matched and I can go ahead and reset your
password in AD..." ' This wouldn't work. Where do I need to put this
Label.Text ="..." ?
Else
Response.Redirect("myNextPage")
'Display on next page Label.Text = "The phrase(s) you typed didn't
match. Please click back button and resubmit info."
'If possible, I would like to display all phrases that did not match
in 'myNextPage', so that user would know which ones he didn't answer
correctly.
End If
End SubIn that case u may choose to write all logic of stored procedure in asp.net
itsself.
-jignesh
www.dotnetjini.com
"Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl...
> I understand that store procedures are the recommended way to handle SQL
> queries from an ASP application. However I am working on a small academic
> assignment and I just need to get this over with. I created the store
> procedure but now the teacher didn't accept that, as he is concerned he
> would need to install the store procedure in Query Analyzer from his end.
> Can you please clarify how I would be to do the following using a Select
> Statement (VB.NET, ASP.NET 2.0):
>
> Dim myNextPage
> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
> Dim myString
> myString = "SELECT Employee From Pubs " _
> & "WHERE job_id = " & TxtBox1.Text And
> & "WHERE employee_name = " & TxtBox2.Text And
> & "WHERE hire_date = " & TxtBox3.Text
> 'Now I want to:
> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
> (hire_date = TxtBox3.Text) Then
> Response.Redirect("myNextPage")
> 'Then on Next page I would like to display label.Text = "Your
> information matched and I can go ahead to reset your password in AD..."
> 'However doing:
> label.Text = "Your info matched and I can go ahead and reset your
> password in AD..." ' This wouldn't work. Where do I need to put this
> Label.Text ="..." ?
> Else
> Response.Redirect("myNextPage")
> 'Display on next page Label.Text = "The phrase(s) you typed didn't
> match. Please click back button and resubmit info."
> 'If possible, I would like to display all phrases that did not match
> in 'myNextPage', so that user would know which ones he didn't answer
> correctly.
> End If
> End Sub
>
Ok, if you can't show me the SQL part OK, but could you help me with on how
to display whatever variable I capture from the SQL query on .ASP.NET ?
I tried to use Response.Write(TextBox1.Text) but that didn't returned
satisfactory results. I understand I shouldn't use Response.Write and
therefore I attempted to create a Label1.Text to display whatever
information I got from SQL. The problem is that I do Label1.Text =
InfoFromSQL and that doesn't work either. It returns nothing on the
Label1.Text.
'Then on Next page I would like to display label.Text = "Your
'information matched and I can go ahead to reset your password in AD..."
' 'However doing:
' label.Text = "Your info matched and I can go ahead and reset your
' password in AD..." ' This wouldn't work. Where do I need to put this
' Label.Text ="..." ?
I am trying to
"Jignesh Desai" <jignesh_desai@.hotmail.com> wrote in message
news:O8z%238QhJFHA.2356@.TK2MSFTNGP14.phx.gbl...
> In that case u may choose to write all logic of stored procedure in
> asp.net
> itsself.
> -jignesh
> www.dotnetjini.com
> "Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
> news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl...
>
Labels do not produce actual HTML control on the client-side so have no way
to postback to the server. I believe you can store you texts in Session
variable.
Session["yourmsg"] = "Your info matched and I can go ahead and reset your
password in AD..."
Then in the other page:
label.Text = CStr(Session["yourmsg"])
You may use Session variable to store anything, including ArrayList and
access it on other pages in the same session. Just rememeber to CType it
back when you retrieve it.
"Marlon Brown" <marlon_brownj@.hotmail.com> bl
news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl g...
> I understand that store procedures are the recommended way to handle SQL
> queries from an ASP application. However I am working on a small academic
> assignment and I just need to get this over with. I created the store
> procedure but now the teacher didn't accept that, as he is concerned he
> would need to install the store procedure in Query Analyzer from his end.
> Can you please clarify how I would be to do the following using a Select
> Statement (VB.NET, ASP.NET 2.0):
>
> Dim myNextPage
> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
> Dim myString
> myString = "SELECT Employee From Pubs " _
> & "WHERE job_id = " & TxtBox1.Text And
> & "WHERE employee_name = " & TxtBox2.Text And
> & "WHERE hire_date = " & TxtBox3.Text
> 'Now I want to:
> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
> (hire_date = TxtBox3.Text) Then
> Response.Redirect("myNextPage")
> 'Then on Next page I would like to display label.Text = "Your
> information matched and I can go ahead to reset your password in AD..."
> 'However doing:
> label.Text = "Your info matched and I can go ahead and reset your
> password in AD..." ' This wouldn't work. Where do I need to put this
> Label.Text ="..." ?
> Else
> Response.Redirect("myNextPage")
> 'Display on next page Label.Text = "The phrase(s) you typed didn't
> match. Please click back button and resubmit info."
> 'If possible, I would like to display all phrases that did not match
> in 'myNextPage', so that user would know which ones he didn't answer
> correctly.
> End If
> End Sub
>
Newbie:please help me display this on a simple .aspx page
queries from an ASP application. However I am working on a small academic
assignment and I just need to get this over with. I created the store
procedure but now the teacher didn't accept that, as he is concerned he
would need to install the store procedure in Query Analyzer from his end.
Can you please clarify how I would be to do the following using a Select
Statement (VB.NET, ASP.NET 2.0):
Dim myNextPage
myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
Dim myString
myString = "SELECT Employee From Pubs " _
& "WHERE job_id = " & TxtBox1.Text And
& "WHERE employee_name = " & TxtBox2.Text And
& "WHERE hire_date = " & TxtBox3.Text
'Now I want to:
If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
(hire_date = TxtBox3.Text) Then
Response.Redirect("myNextPage")
'Then on Next page I would like to display label.Text = "Your
information matched and I can go ahead to reset your password in AD..."
'However doing:
label.Text = "Your info matched and I can go ahead and reset your
password in AD..." ' This wouldn't work. Where do I need to put this
Label.Text ="..." ?
Else
Response.Redirect("myNextPage")
'Display on next page Label.Text = "The phrase(s) you typed didn't
match. Please click back button and resubmit info."
'If possible, I would like to display all phrases that did not match
in 'myNextPage', so that user would know which ones he didn't answer
correctly.
End If
End SubIn that case u may choose to write all logic of stored procedure in asp.net
itsself.
-jignesh
www.dotnetjini.com
"Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl...
> I understand that store procedures are the recommended way to handle SQL
> queries from an ASP application. However I am working on a small academic
> assignment and I just need to get this over with. I created the store
> procedure but now the teacher didn't accept that, as he is concerned he
> would need to install the store procedure in Query Analyzer from his end.
> Can you please clarify how I would be to do the following using a Select
> Statement (VB.NET, ASP.NET 2.0):
>
> Dim myNextPage
> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
> Dim myString
> myString = "SELECT Employee From Pubs " _
> & "WHERE job_id = " & TxtBox1.Text And
> & "WHERE employee_name = " & TxtBox2.Text And
> & "WHERE hire_date = " & TxtBox3.Text
> 'Now I want to:
> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
> (hire_date = TxtBox3.Text) Then
> Response.Redirect("myNextPage")
> 'Then on Next page I would like to display label.Text = "Your
> information matched and I can go ahead to reset your password in AD..."
> 'However doing:
> label.Text = "Your info matched and I can go ahead and reset your
> password in AD..." ' This wouldn't work. Where do I need to put this
> Label.Text ="..." ?
> Else
> Response.Redirect("myNextPage")
> 'Display on next page Label.Text = "The phrase(s) you typed didn't
> match. Please click back button and resubmit info."
> 'If possible, I would like to display all phrases that did not match
> in 'myNextPage', so that user would know which ones he didn't answer
> correctly.
> End If
> End Sub
Ok, if you can't show me the SQL part OK, but could you help me with on how
to display whatever variable I capture from the SQL query on .ASP.NET ?
I tried to use Response.Write(TextBox1.Text) but that didn't returned
satisfactory results. I understand I shouldn't use Response.Write and
therefore I attempted to create a Label1.Text to display whatever
information I got from SQL. The problem is that I do Label1.Text =
InfoFromSQL and that doesn't work either. It returns nothing on the
Label1.Text.
'Then on Next page I would like to display label.Text = "Your
'information matched and I can go ahead to reset your password in AD..."
' 'However doing:
' label.Text = "Your info matched and I can go ahead and reset your
' password in AD..." ' This wouldn't work. Where do I need to put this
' Label.Text ="..." ?
I am trying to
"Jignesh Desai" <jignesh_desai@.hotmail.com> wrote in message
news:O8z%238QhJFHA.2356@.TK2MSFTNGP14.phx.gbl...
> In that case u may choose to write all logic of stored procedure in
> asp.net
> itsself.
> -jignesh
> www.dotnetjini.com
> "Marlon Brown" <marlon_brownj@.hotmail.com> wrote in message
> news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl...
>> I understand that store procedures are the recommended way to handle SQL
>> queries from an ASP application. However I am working on a small academic
>> assignment and I just need to get this over with. I created the store
>> procedure but now the teacher didn't accept that, as he is concerned he
>> would need to install the store procedure in Query Analyzer from his end.
>> Can you please clarify how I would be to do the following using a Select
>> Statement (VB.NET, ASP.NET 2.0):
>>
>>
>>
>> Dim myNextPage
>> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
>>
>> Dim myString
>> myString = "SELECT Employee From Pubs " _
>> & "WHERE job_id = " & TxtBox1.Text And
>> & "WHERE employee_name = " & TxtBox2.Text
>> And
>> & "WHERE hire_date = " & TxtBox3.Text
>>
>> 'Now I want to:
>> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
>> (hire_date = TxtBox3.Text) Then
>> Response.Redirect("myNextPage")
>> 'Then on Next page I would like to display label.Text = "Your
>> information matched and I can go ahead to reset your password in AD..."
>> 'However doing:
>> label.Text = "Your info matched and I can go ahead and reset your
>> password in AD..." ' This wouldn't work. Where do I need to put this
>> Label.Text ="..." ?
>>
>> Else
>> Response.Redirect("myNextPage")
>> 'Display on next page Label.Text = "The phrase(s) you typed didn't
>> match. Please click back button and resubmit info."
>> 'If possible, I would like to display all phrases that did not
>> match
>> in 'myNextPage', so that user would know which ones he didn't answer
>> correctly.
>>
>> End If
>>
>> End Sub
>>
>>
Labels do not produce actual HTML control on the client-side so have no way
to postback to the server. I believe you can store you texts in Session
variable.
Session["yourmsg"] = "Your info matched and I can go ahead and reset your
password in AD..."
Then in the other page:
label.Text = CStr(Session["yourmsg"])
You may use Session variable to store anything, including ArrayList and
access it on other pages in the same session. Just rememeber to CType it
back when you retrieve it.
"Marlon Brown" <marlon_brownj@.hotmail.com> bl
news:e7u1sygJFHA.2772@.TK2MSFTNGP14.phx.gbl g...
> I understand that store procedures are the recommended way to handle SQL
> queries from an ASP application. However I am working on a small academic
> assignment and I just need to get this over with. I created the store
> procedure but now the teacher didn't accept that, as he is concerned he
> would need to install the store procedure in Query Analyzer from his end.
> Can you please clarify how I would be to do the following using a Select
> Statement (VB.NET, ASP.NET 2.0):
>
> Dim myNextPage
> myNextPage = "ConfirmInput.aspx" 'On this page I put a label.Text there.
> Dim myString
> myString = "SELECT Employee From Pubs " _
> & "WHERE job_id = " & TxtBox1.Text And
> & "WHERE employee_name = " & TxtBox2.Text And
> & "WHERE hire_date = " & TxtBox3.Text
> 'Now I want to:
> If (TxtBox1.Text = job_id ) And (employee_name = TxtBox2.Text) And
> (hire_date = TxtBox3.Text) Then
> Response.Redirect("myNextPage")
> 'Then on Next page I would like to display label.Text = "Your
> information matched and I can go ahead to reset your password in AD..."
> 'However doing:
> label.Text = "Your info matched and I can go ahead and reset your
> password in AD..." ' This wouldn't work. Where do I need to put this
> Label.Text ="..." ?
> Else
> Response.Redirect("myNextPage")
> 'Display on next page Label.Text = "The phrase(s) you typed didn't
> match. Please click back button and resubmit info."
> 'If possible, I would like to display all phrases that did not match
> in 'myNextPage', so that user would know which ones he didn't answer
> correctly.
> End If
> End Sub
Friday, March 16, 2012
News Letter
How to store email address?
What software we use for newsletter?
I dont know anything about news letter.Hey,
If you have Office, use Word to do a newsletter. Store the email address of who it goes to and the path to the newsletter in the database, then write a program or manually send out the newsletter based on the email addresses there. You probably don't have to store the path to the newsletter if you are doing only one a month.
Brian
I have my newsletter written in HTML.
I have all the email addresses stored in database.
I want to use asp.net to send the newsletter.
For sending to multiple email addresses, stored in a database:
http://aspnet101.com/aspnet101/tutorials.aspx?id=15 (actually two different tutorials on this - two different ways of doing it.
for reading an HTML based text file:
http://aspnet101.com/aspnet101/aspnet/codesample.aspx?code=wishes