|
I see the problem.
I did not work this out but I think it's a good thougt to start with:
Each user which is visiting your website gets a unique session id, you could make a collection where you keep a unique combination of a specific session id and the page url. When Application_BeginRequest is fired you can check if for that session id the mentioned url is already in the collection, if not ad it. When you want to know how many unique hits you got, you can get the count of the collection ...
Does this helps?
|
|
|
|
|
Help Needed!!!!!
-using a datalist to display data from sql200,
-there's a product id im getting from the database and put on the url like so..http://mfashion/productlist?productID=2
-is there a way or which is the best way i can get that productid from the from the url..cause i want to use that id through out my apps.
-by the way im using asp.net 2.0
|
|
|
|
|
You might look at the Request object.
string s = Request["productID"].ToString();
Also, you will need to trap for nulls.
|
|
|
|
|
hi all,
how can i delay the download of a file like on sourcefourge and alot of other sites where you get a link saying 'If your download doesnt start in 5 secs please click here' or something simlar.
i had been doing it on page load or pre_render but the page doesnt load. This way looks alot better.
kind regards,
g00fy
|
|
|
|
|
You have to have two pages. The first one is used to display that "if your download ..." text. The second streams the file to the user (download.aspx).
So all you have to do is redirect the use on the first page to the second. You use JavaScript for that (a simple document.location can do the trick). And you make a timer with setTimeout() to make the user wait for X seconds.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
thanx
i also found some pages that use meta refresh to acheive the same thing
regs,
g00fy
|
|
|
|
|
hi guy's ,
i just want to extract data from my excel sheet to sql server 2005.how do i do this task in asp.net 2.0
please be kindly give me a solution or a sample soon as possible.
regards
amal
|
|
|
|
|
I'm working with VS 2005 , I have a login control in my website. When I debugg it everything works fine (authentication), but when I publish the website and open it from another computer, it doesn´t recognize my login account :
Can somebody help?
|
|
|
|
|
May be its still configured for local browsing only for this user.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
How can I configure it for all kind of browsing??
|
|
|
|
|
hi how r u ?
am using forms authentication i think i made everything required
authentication mode="Forms"
<forms name=".aspxauth" loginurl="login.aspx">
void LoginBtn_Click(Object sender, EventArgs e)
{
if (Page.IsValid)
{ String EmpNo=Get_EmpNo_Login();
// a function that gets EmpNo and sets the login_err textfield (if autherized = "allowed")
if(Login_err.Text=="allowed")
{
if(EmpNo!="-100")//not autherized, just to make sure.
Response.Redirect("HomePage.aspx");
}
}
}
will i cant redirect the user to HomePage or anywhere it keeps redirecting to the login.aspx
am i missing sth?????
thx
-- modified at 16:47 Monday 8th May, 2006
|
|
|
|
|
You have forgotten callinh the Authenticate() method.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Can someone explain to me the correlation between the COM threading model of a web service consumer and the web service if that web service is not using COM components?
I have a simple test web service generated straight out of the VS 2003 web service wizard. It has a single WebMethod that consists entirely of a Thread.Sleep(500); call. I created a simple console app that will attempt to call the web service method 10 times. It will do so either on the main thread or on a new separate thread based on user input. The Main method of the tester is marked [STAThread]. If I call the web service method on the main thread there is no problem. If I then call it on a separate thread, the invocation freezes in the web service proxy and never gets into the web service. If I then call the web service from the main thread, the main thread works and the frozen thread unfreezes and the two sets of calls are interspersed. If I quit the application and run again, this time calling the web service on the separate thread first, the web service is called correctly. I can then call the web service on the main thread or another new thread no problem. If I change the designation of Main to [MTAThread], I can now run in any order I want.
Is there some COM thing going on am unaware of in the web service invocation? Or is this freezing problem unrelated to COM but then why does the COM threading model change have an effect.
Thanks for any help
|
|
|
|
|
When a user scrolls to the bottom of the page and clicks a button a similar page is displayed. When this second pages displays I would like it to automatically scroll down to the bottom as was the first page. Can this be done?
|
|
|
|
|
You can achive this with anchors.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I setup anchor tags to link to the other pages and link to those pages using the following code:
response.redirect("bottletype.aspx#target")
It works good for all but one of the pages. On that page it does not display the entire string in the browser. Instead of
http://localhost:1340/CollingwoodWater/bottletype.aspx#target
it shows
http://localhost:1340/CollingwoodWater/bottletype.aspx
So it does not anchor. Why doesn't display "#target" as part of the address?
|
|
|
|
|
if using IE try
SmartNavigation = true;
|
|
|
|
|
hi dptalt,
You can write "SmartNavigation=True" in @Page directive of a page if using IE.
you can also try for "MaintainScrollPositionOnPostBack=true".
Best of luck.
Tirtha
Tirthadip
|
|
|
|
|
Use SmartNavigation in ASp.net
But it will work only in IE
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hello,
I first created a class called BreadCrumbs.cs. Here is a snippet of code...
***Portion of BreadCrumbs.cs code***
namespace Sabre_Solutions
{
///
/// Summary description for BreadCrumbs.
///
public class ctrlBreadCrumbs:System.Web.UI.WebControls.WebControl
{
public string Separator = ">";
public string RootName = "Home Page";
public char directoryNameSpacer = '_';
private string _PageTitle;
public string PageTitle
{
get
{
***and so on...****
Okay, second part. Created my own control called BreadCrumbs.ascx. This is its code (in entirety)
***code for BreadCrumbs.ascx
<%@ Register TagPrefix = "bc" Namespace = "Sabre_Solutions" Assembly = "BreadCrumbs"%>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="BreadCrumbs.ascx.cs" Inherits="Sabre_Solutions.BreadCrumbs" %>
****End .asxc***
Part three, the code behind..
****BreadCrumbs.asc.cs*******
namespace Sabre_Solutions
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Text;
///
/// Summary description for BreadCrumbs.
///
public class BreadCrumbs : System.Web.UI.UserControl
{
protected ctrlBreadCrumbs bc1;
private string _strHeaderText;
public string HeaderText
{
get
{
return _strHeaderText;
}
set
{
_strHeaderText = value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
bc1.PageTitle = HeaderText;
}
***and so on...***
So the question. Everything compiles correctly, but when I drop the control into an .aspx file and try to run I get this error:
The base class includes the field 'bc1', but its type (Sabre_Solutions.ctrlBreadCrumbs) is not compatible with the type of control (Sabre_Solutions.ctrlBreadCrumbs).
I've been searching online and it seems to be a common problem, but none of the answers were on point (for me anyhow). I've tried changing a number of things but with no luck. I'm sure it's something small...can anyone see it?
-- modified at 14:35 Monday 8th May, 2006
|
|
|
|
|
***Portion of BreadCrumbs.cs code***
namespace Sabre_Solutions
{
///
/// Summary description for BreadCrumbs.
///
public class ctrlBreadCrumbs:System.Web.UI.WebControls.WebControl
{
public string Separator = ">";
public string RootName = "Home Page";
public char directoryNameSpacer = '_';
private string _PageTitle;
public string PageTitle
{
get
{
***and so on...****
Okay, second part. Created my own control called BreadCrumbs.ascx. This is its code (in entirety)
***code for BreadCrumbs.ascx
<%@ Register TagPrefix = "bc" Namespace = "Sabre_Solutions" Assembly = "BreadCrumbs"%>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="BreadCrumbs.ascx.cs" Inherits="Sabre_Solutions.BreadCrumbs" %>
****End .asxc***
Part three, the code behind..
****BreadCrumbs.asc.cs*******
namespace Sabre_Solutions
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Text;
///
/// Summary description for BreadCrumbs.
///
public class BreadCrumbs : System.Web.UI.UserControl
{
protected ctrlBreadCrumbs bc1;
private string _strHeaderText;
public string HeaderText
{
get
{
return _strHeaderText;
}
set
{
_strHeaderText = value;
}
}
private void Page_Load(object sender, System.EventArgs e)
{
bc1.PageTitle = HeaderText;
}
***and so on...***
It seems to me that your base class should inherit usercontrol not web control. Then your usercontrol codefile should inhert the base class.
Like this
//Base class
public class ctrlBreadCrumbs:System.Web.UI.UserControl
{
}
//User Control
public class BreadCrumbs : ctrlBreadCrumbs
{
}
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
ToddHileHoffer wrote: It seems to me that your base class should inherit usercontrol not web control. Then your usercontrol codefile should inhert the base class.
Like this
//Base class
public class ctrlBreadCrumbs:System.Web.UI.UserControl
{
}
//User Control
public class BreadCrumbs : ctrlBreadCrumbs
{
}
Okay, made those changes. So my snippets look like this...
***BreadCrumbs.cs***
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Text;
using System.Web;
namespace Sabre_Solutions
{
///
/// Summary description for BreadCrumbs.
///
public class ctrlBreadCrumbs:System.Web.UI.UserControl
{
public string Separator = ">";
public string RootName = "Home Page";
public char directoryNameSpacer = '_';
private string _PageTitle;
public string PageTitle
{
get
***and so on***
***Breadcrumbs.ascx***
<%@ Register TagPrefix = "bc" Namespace = "Sabre_Solutions" Assembly = "BreadCrumbs"%>
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="BreadCrumbs.ascx.cs" Inherits="Sabre_Solutions.BreadCrumbs" %>
<bc:ctrlbreadcrumbs id="bc1" runat="server">
***END***
***BreadCrumbs.ascx.cs***
namespace Sabre_Solutions
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.ComponentModel;
using System.Text;
///
/// Summary description for BreadCrumbs.
///
public class BreadCrumbs : ctrlBreadCrumbs
{
protected BreadCrumbs bc1;
private string _strHeaderText;
public string HeaderText
{
get
{
return _strHeaderText;
}
set
***and so one****
Now, when I compile I get the following error:
c:\inetpub\wwwroot\Sabre Solutions\BreadCrumbs.ascx.cs(16): 'Sabre_Solutions.ctrlBreadCrumbs' is defined in multiple places; using definition from 'c:\inetpub\wwwroot\Sabre Solutions\BreadCrumbs.cs' (I bolded the line it's referencing.)
Just for giggles I tried to run just the .aspx form that has the control. I still get the error but it's slightly different...
The base class includes the field 'bc1', but its type (Sabre_Solutions.BreadCrumbs) is not compatible with the type of control (Sabre_Solutions.ctrlBreadCrumbs
Any other ideas? My brain is fried at this point.
|
|
|
|
|
How to connect Active Directory using LDAP? The code should work in ASP and ASP.Net.
Thanks for your help.
|
|
|
|
|
public bool AuthenticateUser(string domain, string username, string password)
{ string LDAPPATH ="LDAP://appserver.com";
string domainAndUsername = domain + @"\" + username;
DirectoryEntry entry = new DirectoryEntry( "LDAP://appServer.com", domainAndUsername, password);
try
{
// Bind to the native AdsObject to force authentication.
Object obj = entry.NativeObject;
DirectorySearcher search = new DirectorySearcher(entry);
search.Filter = "(SAMAccountName=" + username + ")";
search.PropertiesToLoad.Add("cn");
SearchResultCollection result = search.FindAll();
if( result.Count==0)
{
return false;
}
}
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
-- modified at 4:42 Tuesday 9th May, 2006
|
|
|
|
|
Hi Himabindu,
Thank you for your code, but what I need is the code should work in both ASP and ASP.Net. Without using directory services it should work in both.
for ex. in ASP
strADsPath = "LDAP://strservername/DC=xxx,DC=com"
Set objldap = GetObject(strObjectADsPath)
objldap.GetInfo
above code will work in ASP but how to execute same code in asp.net
|
|
|
|