|
Did you google it 1st before asking here?
|
|
|
|
|
Yes i google first. However i am new to asp.net 2010. i only have a little web experience using classic asp. Thus I am looking for suggestions on how to get started.
|
|
|
|
|
|
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "window.open( 'frmPMaster.aspx', null, 'status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no' );", true);
First i opened an window by the above method, new window is opened. Again try to open an new window from the opened window but this time new windows is not opened. instead of pageis opened in the same windows. i need to open in a new window.please help me.
Thanks in advance.
Have A Nice Day!
Murali.M
Blog
|
|
|
|
|
Hello Everyone,
I am trying to use cookies in Custom Role Provider as sessions are showing null exception...
In my login.aspx I am using
Dim newCookie As HttpCookie = New HttpCookie("AccessRights")
newCookie.Values.Add("AccessRights", accessRights)
newCookie.Expires = #12/31/2012#
Response.Cookies.Add(newCookie)
In GetRolesForUser, I am trying to retrive the information from the cookie
If Not Request.Cookies("accessRights") Is Nothing Then
Dim foo as String = (Request.Cookies("accessRights").Value
End if
But it does not like the syntax. Get " Reference to a non-shared member requires an object reference error.
Please advice whether cookies will work in Custom Role Provider in ASP.NET 2.0
Kapil
.
|
|
|
|
|
|
hi
i am new user of asp.net. i given a link name form.pdf and i given a link like this <a href="form.pdf">form</a>
when i click on this link of form there is problem shows format error. not a PDF or currepted. while working very well on my machine (localhost) when i upload my site on server this problem occurres.
plz help me
thanks
I will do my best?
Integrated Solutions, Bikaner (Raj.), India
|
|
|
|
|
During the web development some time we need to add dynamic controls to a web page. Mostly developer’s face problems with dynamically added controls that they can’t get the event as the page post back.
I was also struggling with this issue and at the end I have found two possible solutions
1:- Add the control on page_Init
private void Page_Init(object sender, System.EventArgs e)
{
if (!IsPostBack)
AddControls();
}
private void Page_Load(object sender, System.EventArgs e)
{
}
private void AddControls()
{
TextBox dynamictextbox = new TextBox();
dynamictextbox.Text = "(Enter some text)";
dynamictextbox.ID = "dynamictextbox";
Button dynamicbutton = new Button();
dynamicbutton.Click += new System.EventHandler(dynamicbutton_Click);
dynamicbutton.Text = "Dynamic Button";
Panel1.Controls.Add(dynamictextbox);
Panel1.Controls.Add(new LiteralControl("<BR>"));
Panel1.Controls.Add(new LiteralControl("<BR>"));
Panel1.Controls.Add(dynamicbutton);
ViewState["controlsadded"] = true;
}
private void dynamicbutton_Click(Object sender, System.EventArgs e)
{
TextBox tb = new TextBox();
tb = (TextBox) (Panel1.FindControl("dynamictextbox"));
Label1.Text = tb.Text;
}
2:-Override method LoadViewState
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
AddControls();
}
protected override void LoadViewState(object savedState)
{
base.LoadViewState(savedState);
if (ViewState["controsladded"] == null)
AddControls();
}
private void AddControls()
{
TextBox dynamictextbox = new TextBox();
dynamictextbox.Text = "(Enter some text)";
dynamictextbox.ID = "dynamictextbox";
Button dynamicbutton = new Button();
dynamicbutton.Click += new System.EventHandler(dynamicbutton_Click);
dynamicbutton.Text = "Dynamic Button";
Panel1.Controls.Add(dynamictextbox);
Panel1.Controls.Add(new LiteralControl("<BR>"));
Panel1.Controls.Add(new LiteralControl("<BR>"));
Panel1.Controls.Add(dynamicbutton);
ViewState["controlsadded"] = true;
}
private void dynamicbutton_Click(Object sender, System.EventArgs e)
{
TextBox tb = new TextBox();
tb = (TextBox) (Panel1.FindControl("dynamictextbox"));
Label1.Text = tb.Text;
}
Hope will work for you
Thanks to MSDN
http://msdn.microsoft.com/en-us/library/aa287574%28v=vs.71%29.aspx
|
|
|
|
|
Seeing that you claim this is a solution, if i were you i wouldn't post it as a question but rather write an article on the topic at hand. There's a facility to write articles on CodeProject, try that maybe?
|
|
|
|
|
Hi there,
Not sure if this is the right forum or not, but I thought I'd ask away.
Our product is thick client/server architecture. We have created a Web-based interface for our product using ASP.NET which does some basic lookups/field changes. We want to take it a step further and create a custom control within a webpage to show our floor-plan module.
Our thick client is written in C/C++, and I realize that in order to do what we want, we would need to port this code over to something a little more browser friendly.
Question:
What language/tools would give me the ability to:
a) Have a canvas where I can custom draw lines, shapes etc.
b) Get Click, Mouse Move events
.. All within a web-browser?
Any help/links you could provide would be great.
Cheers.
M.
|
|
|
|
|
Visual Studio should be able to give you some of the features you are requesting for.
Too much of heaven can bring you underground
Heaven can always turn around
Too much of heaven, our life is all hell bound
Heaven, the kill that makes no sound
|
|
|
|
|
I am going to be designing a new C#.net 2010 web page. i would like to know what designer tools I can use to graphically show what the new webpages will look like. What would you recommend?
|
|
|
|
|
|
Dear All,
I'm pretty good with C# however I can't figure out ASP.NET with C#. It's not the C# bit that gives me headaches but the ASP stuff. I have the following problem.
I've created an ASP website ( not entirely true, I used one of VS2010 templates ) and it's has login functionality. I'm using a Postgresql database in the backend and I can login fine. My Site.Master page got buttons in it, but I want a whole new series of buttons when the user has logged on correctly. I've created a new .aspx site that needs to load with a new Master Page. So I've created a new master page, called Site1.Master. It's pretty much the same as Site.Master but it allows me to use different buttons. But for some reason the login information is not display when this new page is loaded. Only after I hit 'F5' on my keyboard ( refresh ) it will show the info and the page works properly.
Site.Master :
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="Urenboeken.SiteMaster" %>
<!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" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
KMO Urenboeken
</h1>
</div>
<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <asp:LoginName ID="HeadLoginName" runat="server" />!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>
</div>
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Over"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
and my new Site1.Master :
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="Urenboeken.Site1" %>
<!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" xml:lang="en">
<head id="Head1" runat="server">
<title></title>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="Form1" runat="server">
<div class="page">
<div class="header">
<div class="title">
<h1>
KMO Urenboeken
</h1>
</div>
<div class="loginDisplay">
<asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false">
<AnonymousTemplate>
[ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ]
</AnonymousTemplate>
<LoggedInTemplate>
Welcome <asp:LoginName ID="HeadLoginName" runat="server" />!
[ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ]
</LoggedInTemplate>
</asp:LoginView>
</div>
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Terug naar Huis"/>
<asp:MenuItem NavigateUrl="~/About.aspx" Text="Over van alles en nog wat"/>
</Items>
</asp:Menu>
</div>
</div>
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>
And my new .aspx file :
<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
CodeBehind="Time.aspx.cs" Inherits="Urenboeken.Account.Time" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
</asp:Content>
I load my new .aspx file form the login.aspx when the user is logged on correctly.
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.LoginUser.LoggedIn += LoginUser_LoggedIn;
}
void LoginUser_LoggedIn(object sender, EventArgs e)
{
Server.Transfer("Time.aspx", true);
}
}
Can someone tell me what I am doing wrong. Or am I going about it in a very wrong way to accomplish what I want. I hope someone can help out.
Kind regards,
|
|
|
|
|
Often, when a problem is "fixed" by a browser refresh, it's because of caching (in the browser or in the proxy). If the "new" page has the same name as the old page and the timestamp of the aspx itself hasn't changed (like it has a new master or CSS or something else external to it), the browser will just say to itself "I already have this in my cache. Not gonna bother downloading another copy."
Yeah, okay, it's doing a HEAD before a GET, and if the HEAD isn't different from the last HEAD it got, it won't do anything. But that's a boring way to put it.
|
|
|
|
|
I suspect that the issue is with the Server.Transfer - try swapping it out for a Response.Redirect..
Server.Transfer only (IIRC) changes the "context" on the server, so as far as the server's concerned, you're on that page, but as far as the client is concerned, you're still on the original page. Response.Redirect should keep the browser end in check too.
C# has already designed away most of the tedium of C++.
|
|
|
|
|
Richard,
Thank you for your reply. Response.Redirect fixed the problem. And also many thanks to GenJerDan for explaining to me what caused the issue in the first place.
Kind regards,
|
|
|
|
|
hello i have developped an asp .net website, but the password manager/autocomplete feature on ie9 does not work. Although it works fine on firefox 6 and chrome. Has anyone else encounteres this problem?
|
|
|
|
|
I need some clever regular expression writing in IIS7 to redirect traffic from one site to another, the pages are similar in structure but information needs re-writing.
Here's an example:
http://www.mysite.com/manufacturers/Name_of_Manufacturer_6828/Name_OF_Product_43146.htm
needs to be structured as the following
http://www.newsite.co.in/free-msds-download/name-of-manufacturer/name-of-product/
Here's what needs changing:
1). Only Alpha, Numeric and hyphen's allowed.
2). Change '_' to '-'.
3). Remove the '_NUMBER' directly after the manufacturer name and before the '/'.
4). Remove the '_NUMBER' directly after the product name and before the '.htm'.
5). Remove the '.htm' and replace with a '/'.
It needs writing into the code below please as a permanent 301 redirect:
|
|
|
|
|
|
guys;
when I call ScriptManager.SetFocus() from the server, I get this error message on Google Chrome:
Error:Uncaught TypeError: Cannot read property '_notified' of null
function Sys$_ScriptLoader$_scriptLoadedHandler(scriptElement, loaded) {
if(loaded && this._currentTask._notified) {
...
}
...
}
could any one please help me with this?
Help people,so poeple can help you.
modified on Sunday, September 11, 2011 3:37 AM
|
|
|
|
|
iam working on asp.net web site
i have issue from client that i didn't work on it before
they want when internet is offline they work normal & store data
when internet become online they work online & the data they enter offline is moving to online database
is that mean i must have database local & another 1 is on line
or how i'll do something like this
they access application from many duifferent location i need any help
md_refay
|
|
|
|
|
Well, your issue can be done by architets of database and software developement, in general view it can be done by 2 centralized databases, first database which is online and second is setup in any server and whenever user lose internet connection applaiction should do CRUD data on server, when internet connection is avaliable all data from local server should transfer on online database.
I Love T-SQL
"VB.NET is developed with C#.NET"
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
Dynamically generate Textboxes with Ajax AutoCompleteExtender how?
|
|
|
|
|