|
i was just reading a article on Self hosting SignalR Application in Win Service from this url http://damienbod.wordpress.com/2014/06/03/signalr-self-hosting-template-for-a-windows-service/
code was not very clear to me.so here i am pointing out those line of code point wise. apologized for bit big question.
namespace SignalREngineServiceWindowsService
{
static class Program
{
static void Main(string[] args)
{
ServiceBase.Run(new SignalREngineServiceWindowsService());
if (args != null)
{
try
{
Startup.StartServer();
Console.ReadKey();
}
finally
{
Startup.StopServer();
}
}
}
}
}
[assembly: OwinStartup(typeof(Startup))]
namespace SignalREngine
{
public class Startup
{
static CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
public static void StartServer()
{
var cancellationTokenSource = new CancellationTokenSource();
Task.Factory.StartNew(RunSignalRServer, TaskCreationOptions.LongRunning
, cancellationTokenSource.Token);
}
private static void RunSignalRServer(object task)
{
string url = "http://localhost:8089";
WebApp.Start(url);
}
public static void StopServer()
{
_cancellationTokenSource.Cancel();
}
public void Configuration(IAppBuilder app)
{
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration
{
};
hubConfiguration.EnableDetailedErrors = true;
map.RunSignalR(hubConfiguration);
});
}
}
}
1) just see this line...what is the meaning
ServiceBase.Run(new SignalREngineServiceWindowsService());
how we can instantiate namespace because this is the namespace name SignalREngineServiceWindowsService i think we should specify the class name...what u say!
2)
public static void StartServer()
{
var cancellationTokenSource = new CancellationTokenSource();
Task.Factory.StartNew(RunSignalRServer, TaskCreationOptions.LongRunning
, cancellationTokenSource.Token);
}
here we are calling a method with TPL but what is the meaning of this option or param TaskCreationOptions.LongRunning and cancellationTokenSource.Token ?
3)
private static void RunSignalRServer(object task)
{
string url = "http://localhost:8089";
WebApp.Start(url);
}
see this url string url = "http://localhost:8089"; here can't we specify machine IP where self host apps will run? is it mandatory to write like localhost ?
4)
public static void StopServer()
{
_cancellationTokenSource.Cancel();
}
what will happen when this line will be invoked _cancellationTokenSource.Cancel(); ?
how it can stop the signalr hub ?
5)
public void Configuration(IAppBuilder app)
{
app.Map("/signalr", map =>
{
map.UseCors(CorsOptions.AllowAll);
var hubConfiguration = new HubConfiguration
{
};
hubConfiguration.EnableDetailedErrors = true;
map.RunSignalR(hubConfiguration);
});
}
who will call Configuration() function because i found no routine in code from where Configuration() will be called ?
6) RunSignalR() ? is any built-in function ?
7) what is the difference between this line map.RunSignalR(hubConfiguration); and map.MapSignalR(); ?
8) i found another approach to point out the startup class....here it is
static void Main(string[] args)
{
string url = "http://localhost:6118";
using (WebApp.Start<Startup>(url))
{
Console.WriteLine("The Server URL is: {0}", url);
Console.ReadLine();
}
}
class Startup
{
public void Configuration(IAppBuilder MyApp)
{
MyApp.MapSignalR();
}
}
what is Startup class & what it does or what its role in self hosting ?
i just go through a article and after reading it lots of confusion occur. so i just need answer for my question. so it will be great if some one answer point wise.
here i am including few more url which also talk about signalr selfhost but their coding approach is bit different but understandable.
here is those url
http:
https:
http:
tbhattacharjee
|
|
|
|
|
I had developed a dot net website in c#.I want to embed a video in my website,which should be compatible in all browsers without using html5.I had tried but the video is playing or compatible on IE only.What should i do.please provide some suggestions or code.I will be grateful to you.
|
|
|
|
|
I am getting the following error
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<soap:Header>
<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
<wsa:MessageID>urn:uuid:13dee3e0-d36f-4b94-b769-d981fe391ed8</wsa:MessageID>
<wsa:RelatesTo>urn:uuid:a506294f-dea5-4ada-b1b2-a3677e00dcce</wsa:RelatesTo>
<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-0b0b00f2-2c73-47cb-b951-0f2f8f555dd8">
<wsu:Created>2014-10-12T20:04:40Z</wsu:Created>
<wsu:Expires>2014-10-12T20:09:40Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">q0:Security</faultcode>
<faultstring>Microsoft.Web.Services3.Security.SecurityFault: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
at Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion.RequireSoapHeaderFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope requestEnvelope)
at Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage message)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</faultstring>
<faultactor>http://localhost:4190/AeslPSWebService.asmx</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>
and my request is as follows
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<_0:Security soap:actor="www.toromont.com" soap:mustUnderstand="true" xmlns:_0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:_0_1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<_0_1:Timestamp _0_1:Id="Timestamp-135">
<_0_1:Created>2014-10-10T13:48:35.832Z</_0_1:Created>
<_0_1:Expires>2014-10-19T13:53:35.832Z</_0_1:Expires>
</_0_1:Timestamp>
<_0:UsernameToken _0_1:Id="UsernameToken-136">
<_0:Username>sa</_0:Username>
<_0:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Allied@CAT</_0:Password>
</_0:UsernameToken>
</_0:Security>
<par:UserCredentials xmlns:par="http://www.cat.com/MT/2008/11/15/PartStoreRequiredService"/></soapenv:Header>
<soapenv:Body>
<se:getCustomerInformation xmlns:se="http://www.cat.com/MT/2008/11/15/PartStoreRequiredService" xmlns:xsd="http://customerlookup.partstore.domain.webservice.midtier.websolutions.dcs.cat/xsd">
<se:custLookUpInput>
<xsd:custNo>99008</xsd:custNo>
<xsd:custType xsi:nil="true"/>
<xsd:dealerCode>X130</xsd:dealerCode>
</se:custLookUpInput>
</se:getCustomerInformation>
</soapenv:Body>
</soapenv:Envelope>
I have developed this web service for our vendor based on the wsdl they provided. Please help as i am unable to find any solution of it.
|
|
|
|
|
|
I currently find where the user clicked inside an image using e.X and e.Y in an onclick method, but I'd like to show the user what he's pointing at before he clicks and does a postback to the server. Rather like a mouseover. However, I haven't been able to pick up a mouseover event with a JScript function in my .net page.
I barely know JScript, but I have used functions to handle onkeypress events.
Any pointers, articles, links or well-deserved cynical remarks?
|
|
|
|
|
This seems to be a case of never getting the line of code right when doing something you're unsure of. It works this way:
<script>
function myMoveFunction() {
document.getElementById("ImageCaption").innerHTML = "Coords: " + event.x + ", " + event.y ;
}
</script>
<asp:ImageButton id="imagebutton1" runat="server" Width="512" Height="262"
ImageUrl="DrawRoom.aspx?v=0"
OnClick="ImageButton_Click"
onmousemove="myMoveFunction()" />
|
|
|
|
|
Dear all,
I am running the following script on the client-side and the script is failing to update, when there is change in the database. I debugged the script using web-browser debugger and discovered my Jquery scripts are responding back as "304 not modified". I am assuming the server code is sending 304 resp. if so, what tests can I carry out, to help me debug server code, to find where the logic maybe going wrong.
Client-side:
<script src="../Scripts/jquery-1.6.4.js"></script>
<script src="../Scripts/jquery.signalR-2.1.2.min.js"></script>
<script src='<%: ResolveClientUrl("~/signalr/hubs") %>'></script>
<script type="text/javascript">
$(function () {
var notifications = $.connection.NotificationHub;
notifications.client.recieveNotification = function (role, descrip) {
$('#spanNewMessages').text(role);
$('#spanNewCircles').text(descrip);
};
$.connection.hub.start().done(function () {
notifications.server.sendNotifications();
alert("Notifications have been sent.");
}).fail(function (e) {
alert(e);
});
});
</script>
<h1>New Notifications</h1>
<div>
<br />
New <span id="spanNewMessages"></span> = role.<br />
New <span id="spanNewCircles"></span> = descrip.<br />
</div>
The server side code is created signalR hub class and also has sql dependency logic as well:
[HubName("NotificationHub")]
public class notificationHub : Hub
{
string role = "";
string descrip = "";
[HubMethodName("sendNotifications")]
public void SendNotifications()
{
using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["##########"].ConnectionString))
{
string query = "SELECT top 1 [role],[description] FROM [dbo].[User] order by uploadDate desc";
connection.Open();
SqlDependency.Start(GetConnectionString());
using (SqlCommand command = new SqlCommand(query, connection))
{
try
{
command.Notification = null;
DataTable dt = new DataTable();
SqlDependency dependency = new SqlDependency(command);
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
if (connection.State == ConnectionState.Closed)
connection.Open();
var reader = command.ExecuteReader();
dt.Load(reader);
if (dt.Rows.Count > 0)
{
role = dt.Rows[0]["role"].ToString();
descrip = dt.Rows[0]["description"].ToString();
}
connection.Close();
}
catch (Exception ex)
{
throw ex;
}
}
}
Clients.All.RecieveNotification(role, descrip);
}
private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
{
if (e.Info == SqlNotificationInfo.Insert)
{
notificationHub nHub = new notificationHub();
nHub.SendNotifications();
}
}
Any hints would be very much appreciated. Many thanks
|
|
|
|
|
Is there availbe free sms api through we can sms . using c# asp.net application
|
|
|
|
|
|
Directory Listing -- /MyWebTutorial/
--------------------------------------------------------------------------------
Thursday, October 09, 2014 04:59 PM <dir> bin
Thursday, October 09, 2014 04:49 PM <dir> Images
Thursday, October 09, 2014 05:20 PM <dir> JavaScript
Thursday, October 09, 2014 06:51 PM 2,070 MasterPage.Master
Thursday, October 09, 2014 04:18 PM 343 MasterPage.Master.cs
Thursday, October 09, 2014 06:51 PM 782 MasterPage.Master.designer.cs
Thursday, October 09, 2014 06:51 PM 4,968 MyWebTutorial.csproj
Thursday, October 09, 2014 06:51 PM 1,088 MyWebTutorial.csproj.user
Thursday, October 09, 2014 04:15 PM <dir> obj
Thursday, October 09, 2014 04:15 PM <dir> Properties
Thursday, October 09, 2014 04:28 PM <dir> Styles
Thursday, October 09, 2014 05:45 PM 2,014 Web.config
Thursday, October 09, 2014 04:15 PM 1,285 Web.Debug.config
Thursday, October 09, 2014 04:15 PM 1,346 Web.Release.config
--------------------------------------------------------------------------------
Version Information: ASP.NET Development Server 10.0.0.0
|
|
|
|
|
That is not an error. That is a directory listing of your site.
You're seeing it because you haven't created a default page - default.aspx - for your site.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
How to maintain scroll position in chrome in Asp .Net.
I write code for this ...
<pages theme="DarkBlue" maintainScrollPositionOnPostBack="true" asyncTimeout="50000">
in web.config file.
It's work in Mozilla but does't work in chrome.
Can any one help me?
|
|
|
|
|
Have you checked for the value of maintainScrollPositionOnPostBack in you code to see if something may be resetting it?
I was working on a web page that involved adding code from a third-party and this was changing the value of maintainScrollPositionOnPostBack. We therefore had to reset the value in our code.
|
|
|
|
|
|
I stumped on this one. I want to replace everything in the test text with something else.
I have this
Dim expDIV As String = "(^<div id="specialFooter"|ID="specialFooter")(.*)(</div>)"
Dim elementDIV As System.Text.RegularExpressions.MatchCollection = _
Regex.Matches(p_MessageXHTML, expDIV)
to work this the test text
<div id="specialFooter" class="default_Wrapper_Footer">Anything can be here</div>
But I can't seem to get a match with my expression. I used the actual double quotes at first, then switched to the quot;.
Maybe I should html encoode the input for the match first, but then I would have to encode on the replace as well.
Any help or suggestion would be appreciated.
|
|
|
|
|
Try this:
Dim expDIV As String = "<div\s+(?=[^>]*\b(?i:id)=""specialFooter"")[^>]+>(.+?)</div>"
Dim elementDIV As MatchCollection = Regex.Matches(p_MessageXHTML, expDIV)
This will ignore the case for the name of the id attribute, and will allow the attributes to appear in any order.
If you want the entire match to be case-insensitive, then use:
Dim expDIV As String = "<div\s+(?=[^>]*\bid=""specialFooter"")[^>]+>(.+?)</div>"
Dim elementDIV As MatchCollection = Regex.Matches(p_MessageXHTML, expDIV, RegexOptions.IgnoreCase)
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks Richard!
I spent an hour and a 1/2 last night working on it. Your work is more elegant than what I came up with.
I ended up writing this.
Dim pattern As String = "(<hx5\:footer>)(.*?(\\n)?)+.*?(</hx5\:footer>)"
Dim rx As New Regex(pattern, RegexOptions.IgnoreCase Or RegexOptions.Multiline Or RegexOptions.Singleline)
Dim matches As MatchCollection = rx.Matches(p_MessageXHTML)
el_common.write_eventLog_event_complete("Match Count=" & matches.Count, EventLogEntryType.Information, 0)
If (matches.Count > 0) Then
p_MessageXHTML = rx.Replace(p_MessageXHTML, footerXHTML.ToString)
End If
In case your wondering, this goes to my windows service that sends out advertising emails in conjunction with the ckEditor on the back end used to compose the emails, and the ckEditor plugins I wrote.
This code adds a generated elegant message footer, that says you can unsubscribe, message intended for, time stamp, copyright and stuff.
I was thinking last night, that maybe I should just makeup a element like hx5:footer and replace the content, rather than using the div element with an ID.
Now I'm pondering whether to let the customer select a footer using a new ckEditor custom plugin that they just drop on the page, versus my machine generated footer.
Trying to write and test regex in a windows service didn't work out, and that ^ I had at the front was the problem, and not skipping LF's
I'm going to try yours out, and keep a remark handy for both.
modified 9-Oct-14 14:59pm.
|
|
|
|
|
when the page loads first time, the links work as they should, opening in a Greybox popup(In the Academic Calendar).
Domain Name- http://cpsmau.com/
However, if I do a partial postback (go to september month) , the AJS Greybox functionality is lost and clicking on the link it show on other page not on graybox popup.
Can any one help me?
How do we re-initialize the AJS object on every asynchronous postback.
string script = @"window.addEvent('domready', function() { new AJS(); })";
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), System.Guid.NewGuid().ToString(), script, true);
This script is not working.
My page code is.........
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
DataTable dt = command.ExecuteQuery("SELECT sys_id,date, value,value3 FROM com WHERE branchCode=" + ddlSchool.SelectedValue);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
if (e.Day.Date.CompareTo(Convert.ToDateTime(dt.Rows[i]["date"].ToString())) == 0)
{
if (dt.Rows[i]["value3"].ToString() == "Holiday")
e.Cell.BackColor = System.Drawing.Color.DarkRed;
else
e.Cell.BackColor = System.Drawing.Color.Green;
e.Cell.ForeColor = System.Drawing.Color.LightYellow;
e.Cell.Controls.Clear();
e.Cell.Controls.Add(new LiteralControl("<a id='A1' href='../Common/HolidayAndEventsDetail.aspx?id=" + dt.Rows[i]["sys_id"].ToString() + "', onclick='return window.open(this.href, this.target);' rel='gb_page_center[500,400]' target='_blank' style='display:block;color:white;'>" + e.Day.DayNumberText + "</a>"));
e.Cell.ToolTip = dt.Rows[i]["value"].ToString();
}
}
}
}
|
|
|
|
|
when the page loads first time around, the links work as they should, opening in a pirobox .
However, if I do a partial postback , the pirobox functionality is lost and clicking on the image inside update panel redirects the entire page rather than opening the target page in the pirobox popup.
then i use bellow code on my page load...
Utility.AddScriptEndRequest(this, "SetPiroBox");
when page asynchronous postback then show two iframe with image.
how can i remove this. please give me solutions.
|
|
|
|
|
when the page loads first time around, the links work as they should, opening in a Greybox popup.
However, if I do a partial postback , the AJS Greybox functionality is lost and clicking on the image inside update panel redirects the entire page rather than opening the target page in the Greybox popup.
How do we re-initialize the AJS object on every asynchronous postback.
string script = @"window.addEvent('domready', function() { new AJS(); })";
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), System.Guid.NewGuid().ToString(), script, true);
This script is not working.
|
|
|
|
|
I have a Modal Popup with dynamic controls. I need to add new text box in Button click.
JQuery:-
<script type="text/javascript">
$(document).ready(function(){
if($('#hdnclick').val()==1){
$('#modelPopup').dialog({
autoopen:false,
title: "Add New Server",
width:650,
height:450,
modal:true,
buttons:{
Close:function(){
$(this).dialog('close');
}
}
});
$('#btnadd').click(function(){
alert('okay');
});
}
});
</script>
Aspx Code:-
<asp:GridView ID="grdservices" runat="server" AutoGenerateColumns="false" ShowFooter="true">
<Columns>
<asp:BoundField DataField="S.No" HeaderText="s.no" />
<asp:TemplateField HeaderText="service name">
<ItemTemplate>
<asp:TextBox ID="txtservicename" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="description">
<ItemTemplate>
<asp:TextBox ID="txtDescription" runat="server"></asp:TextBox>
</ItemTemplate>
<FooterStyle HorizontalAlign="right" />
<FooterTemplate>
<asp:Button ID="btnadd" runat="server" Text="add new service" OnClick="btnadd_Click" OnRowCommand="ButtonClicked" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
/asp:GridView>
Code Behind:-
protected void grdServices_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "ButtonClicked")
{
hdnclick.Value = "1";
AddNewRowToGrid();
}
}
private void AddNewRowToGrid()
{
int rowindex = 0;
if (ViewState["CurrentTable"] != null)
{
DataTable dtCurrentTable = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = null;
if (dtCurrentTable.Rows.Count > 0)
{
for (int i = 1; i <= dtCurrentTable.Rows.Count; i++)
{
TextBox Box1 = (TextBox)grdservices.Rows[rowindex].Cells[1].FindControl("txtservicename");
TextBox Box2 = (TextBox)grdservices.Rows[rowindex].Cells[2].FindControl("txtDescription");
drCurrentRow = dtCurrentTable.NewRow();
drCurrentRow["S.No"] = i + 1;
dtCurrentTable.Rows[i - 1]["Column1"] = Box1.Text;
dtCurrentTable.Rows[i - 1]["Column2"] = Box2.Text;
rowindex++;
}
dtCurrentTable.Rows.Add(drCurrentRow);
ViewState["CurrentTable"] = dtCurrentTable;
grdservices.DataSource = dtCurrentTable;
grdservices.DataBind();
}
}
}
My Issue is this "btnAddNewServic_Click" button click fired in first click but this "btnAddNewServic_Click" function not fired in second click even anything is not fired in second click. Can anyone one help me to recover this issue..
|
|
|
|
|
Do you right click in your browser window and look at the source HTML to confirm the button ID name of the button?
I be the name changed, perhaps prefixed with CT100 or something, if so you have to change the ID in the jquery or set the ID to static
|
|
|
|
|
here i got bit code for signalr and included.
client code
$(function () {
var chat = $.connection.chat;
chat.addMessage = function (message) {
$('#messages').append('<li>' + message + '');
};
$("#broadcast").click(function () {
chat.send($('#msg').val());
});
$.connection.hub.start();
});
server code
public class Chat : Hub
{
public void Send(string message)
{
Clients.addMessage(message);
}
}
just see this line Clients.addMessage(message); addMessage() will invoke addMessage() function in client side but think suppose when i am sending data or message to specific client and if that is client is not connected any more then what will happen?
is there any provision in signalr like can we determine that client is connected before delivering data to specific client.
i want to detect a specific client is connected or not before sending data to client. if client is not connected then i will store data in db for that specific user. please help me with sample code that how to detect a specific client is connected or not? thanks
tbhattacharjee
|
|
|
|
|
Imports Microsoft.AspNet.Identity
Imports Microsoft.AspNet.Identity.EntityFramework
Imports Microsoft.AspNet.Identity.Owin
Imports System.Linq
Imports System.Web
Imports System.Web.UI
Imports Microsoft.Owin.Security
Partial Public Class Account_Login
Inherits Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
RegisterHyperLink.NavigateUrl = "Register"
OpenAuthLogin.ReturnUrl = Request.QueryString("ReturnUrl")
Dim returnUrl = HttpUtility.UrlEncode(Request.QueryString("ReturnUrl"))
If Not [String].IsNullOrEmpty(returnUrl) Then
RegisterHyperLink.NavigateUrl += "?ReturnUrl=" & returnUrl
End If
End Sub
Protected Sub LogIn(sender As Object, e As EventArgs) Handles btnLogin.Click
If IsValid Then ' Validate the user password
Dim manager = New UserManager()
Dim user As ApplicationUser = manager.Find(username.Text, password.Text)
Try
If user IsNot Nothing Then
IdentityHelper.SignIn(manager, user, RememberMe.Checked)
IdentityHelper.RedirectToReturnUrl(Request.QueryString("ReturnUrl"), Response)
End If
Catch ex As Exception
FailureText.Text = ex.Message
ErrorMessage.Visible = True
End Try
End If
End Sub
End Class
No error message is generated but when I complete the log-in form nothing happens after I press the Submit button.
When the user logs in and his credentials are validated against the database, the form should ideally disappear and
the user is sent to a Classic ASP Web site already on the WWW. That is, that particular Web site is not part of this small ASP.NET project whose pages will be 'sellotaped' onto that Classsic ASP site. (Eventually, I may try to do that site in ASP.NET but it would be too ambitious for me to try it now.)
How would I code that in my Login.aspx.vb file, or add to the script above, because in the script above there is no reference to a URL path as in 'when you click
on the Go/Submit button, make this log-in form disappear, and take me to www.mysite.com'?
Thanks for reading.
|
|
|
|
|
Member 8761667 wrote: RegisterHyperLink.NavigateUrl = "Register"
Should that be "Register.aspx" or something with an extension
|
|
|
|
|