C# - Check User Is Still Present
Jul 30, 2010Is there a way in ASP.NET to check if the browser where the page was requested is still open? If the browser is closed, a way to stop the request's rendering.
View 3 RepliesIs there a way in ASP.NET to check if the browser where the page was requested is still open? If the browser is closed, a way to stop the request's rendering.
View 3 RepliesMy Database field :
ID Name Age
1 Sumit 23
2 Manish 25
3 John 22
i have two textboxes and 1 button and label1 in my asp.net webform. when i enter Sumit in textbox1 and 23 in textbox2 then it validates the database to check whether then value entered in textbox1 is present in Name column of database and 23 is present in Age column of database....then it redirect to ~.Default2.aspx else shows error message in label.
i want to consume API but not understanding how, I have some things in chunks but not understandable how to use this.
url parameter from text box = 9999999999,8888888888
End Point Defination
GET : []URL
REQQUEST Example :
// These code snippets use an open-source library. http://unirest.io/net Task<HttpResponse<MyClass>> response = Unirest.get("https://dndcheck.p.mashape.com/index.php?mobilenos=9999999999%2C8888888888") .header("X-Mashape-Key", "pNbCJwwIRomshADW9uYFkiP5hgz7p10710KjsnTsk9Kf07qOiw") .asJson();
RESPONSE BODY
This is the response from the service
[ { "mobilenumber": "9999999999", "DND_status": "on", "activation_date": "12-02-2013 00:40", "current_preference": "0", "preference_history": [ { "preference_date": "11-02-2013", "preference": "1#3#6#7", "status": "Active" }, { "preference_date": "07-02-2013", "preference": "0", "status": "Active" }, { "preference_date": "31-01-2013", "preference": "0", "status": "Active" }, { "preference_date": "28-01-2013", "preference": "0",
[CODE]
my requirement is : am having a excel sheet with some values listed i want to pass each value present in any(specified) column to a text box present on a remote page (a site other than mine) as a input and capture the result displayed on the page and then store the input and reuslt side by side in db this should repeat till the end of the input values in the excel sheet.
View 2 RepliesI want to put up a table with a couple columns, and have the user select a row. This will all be from code; not through a DataConnection. GridView seems like it wants to deal with bound controls. What control should I use? ListView doesn't do columns. A table doesn't seem to allow selection. Specifically, what I'm doing is letting the user find a person in active directory. They'll enter the name, and I'm going to present a list of the Active Directory matched results that they can choose from. Is there already some built in control or package that will do this?
View 1 RepliesI have an user control in master page with id 'ucTopUser' and a button 'btnSub'.I need to hide the both control from my current aspx page.How can I do this?
View 1 Repliesi m using Telerik grid to present memos received by user below is the code
[Code]....
where i m binding third column (Subject) my intention is to make an ActionLink where subject is the display text and i want a dynamic ID coming from <#=MemoID#>. memo id is working fine and gives me a link with dynamic Memo IDs. the problem is with the subject i.e ("<#=Subject#>") is rendered as it is on the screen without mapping to the actual subject of the memo. i have also tried ("<%#=Subject%>") but to no gain.
Requirements call for the ability to save search values so that they can select them at later times to return the results without having to re-enter the values. They have the ability to search on 4 different types of data (Date, Time and Lat/Long), so they would like to capture what was entered and ONLY if they chose to save those values, it will be saved and next time they login, if they are searching, they can pick an old search and submit it again.
Im thinking that i add a checkbox next to each button, if they check it, it saves the data into a table with there values and username. Next time they login and go tothe search page, if there are any records for them in the table, i present them with a link that displays all the values stored and if they select one, it will run the search again and present them with the results. does that sound like the right way to handle this request?
There are 10 check boxes in one page. How to code to allow user only check one?
View 1 RepliesThere are 10 check boxes in one page. How to code to allow user only check one?
View 2 RepliesI am trying to add a user control into a div at runtime. I can add the control no probelem but it overwrites the previous control added.Basically, I am trying to add passengers to a travel system - the passenger details are in the user control and I don't know in advance how many there will be. I have an add new passenger button which should append the new user control into the div without overwriting the previous passenger. The code is c#/.net 4. I have tried to save the control data into viewstate and re add it with the new one but that also doesn't work. Here is a snippet of the code I'm using
foreach (Control uc in p_passengers.Controls) {
Passenger p = uc as Passenger;
if (p != null) {
p.SaveValues();
}
}
however, p.SaveAs() (just writes the control values into ViewState) is never hit.
I am createing user dynamially with the below code; string MyPassword = Membership.GeneratePassword(8,0).ToString(); Membership.CreateUser(TextBox7.Text, MyPassword, TextBox8.Text); but before I start creating, I would like to check if the user name is used before or not.
View 2 RepliesHow to Check whether user is valid and authenticated without using Session in ASP.Net ....
View 1 RepliesI want to check if a user in User table is found either in UserName Column or in FriendUserName Column in UserFollow table and if yes display lable found, But if no display lable notfound. This code will be excuted onse a user logs in the connection code
protected void Page_Load(object sender, EventArgs e)
{
if (Session["UserName"] != null && Session["UserName"].ToString() != string.Empty)
{
string userName = Session["UserName"].ToString();
if (!this.IsPostBack)
[code]...
I am developing web application using asp.net. Here i need to access two databases in which one is present on other server. I am able to connect to database present in same server but not with database present in other server.
I am using MS-access. I dont know the changes to be done and syntax for database connection.
i am building a project using C# Asp.Net in which i am registering users with a user id, now my question is that how to check that the user id is already exists in the user table or not when user trying to register, i am using sql server 2000?
View 3 Repliesi want to add code to check if a user is on default.aspx in the master page _load event. how can i check in the master page if the page being requested is default.aspx?
View 3 RepliesI am using Microsoft visual basic 2010 for a asp.net site using c#.
I am using the asp.net configuration for user registration. I have a comments form which I want to appear only if a user is logged in.
I now there is a toolbox helper thing called Login View which does exactly what I want but as soon as I put a form inside the code won't compile because it cannot find the textbox fields.
I have the following in NewsArticle.aspx:
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<div class="postcomment">[code]....
If I take the form out of asp:LoginView it works fine. Inside I get the following:
Error 2 The name 'txtTitle' does not exist in the current context NewsArticle.aspx.cs 59 53 Figmentville
Error 3 The name 'txtComment' does not exist in the current context NewsArticle.aspx.cs 59 68 Figmentville
what is the logic behind this on this website "last activity: 1 min ago from this ip address " If you are obtaining the user's IP address in a hidden field , how can I do this in vb.net ?
And how can I check how many users are online using the application ?
I need to check if the user is logged in at any page, and if not, redirect to Account/LogOn.
An awful way to do it is by adding this code at the beginning of every method in the controllers:
[Code]....
But I hate repeating code so many times. Is there any way to make this check from a single place?
I am a beginner coder, i am building a project using C# Asp.Net in which i am registering users with a user id, now my question is that how to check that the user id is already exists in the user table or not when user trying to register, i am using sql server 2000?
View 4 RepliesI have 3 pages which they use Master page. I want to check if user is authenicated in page load event of master page.
1-Is it correct method to check authenication is page load of master page?
2- I want to know which of the following lines should I user and is there any difference between them?
Request .IsAuthenticated
Page.User.Identity .IsAuthenticated
HttpContext .Current .User .Identity .IsAuthenticated
I want to check if user is autheneicated in control (ascx). I use HttpContext.Current.User.Identity.IsAuthenticated; for this purpose.
When I browse pages using ASP.Net Developement server -VS 2008- it works fine, But when I use IIS 7 then it always return false , even if user is authenicated.
Note that it's even work fine with IIS 6 but With IIS no hope (Classic/Integrated mode). does it related to IIS 7 or what the method that I use?
i have the code to get the members of a local group example administrators
private void GetUserGrps()
{
using (DirectoryEntry groupEntry = new DirectoryEntry("WinNT://./Administrators,group"))
{
foreach (object member in (IEnumerable)groupEntry.Invoke("Members"))
{
using (DirectoryEntry memberEntry = new DirectoryEntry(member))
{
new GUIUtility().LogMessageToFile(memberEntry.Path);
}
}
}
Is there a way to get the groups a local user belongs to using directory services?
without using activedirectory or domain in it because i want for the local machine only and not for a domain.
i have an ASP.NET website which is using a filestream to read in a PDF image from a UNC share on a remote server 2003 box.
i attempt to load the file on the site (which simply embeds a PDF viewer on the site) but when i debug the code, it's throwing a security exception when i attempt to access the file. saying "access to ___ path is denied".
so... i granted access to the UNC path directory to the ASPNET user. i also granted access to the user that's specified for anonymous access in the site itself in IIS.
nothing.
however, i grant "everybody" access and the file comes through.
so, i need to know WHO is trying to access the file. the assumption is either the ASPNET user or the anonymous user setup in IIS. neither of which is gaining access. i tried to set up file auditing on the server2003 box but it's not logging a failure in the security event log when i get an access denied exception.