|
You have to do it programmatically..!
for eg:to find the roles of the user
Response.Write (User.Identity.Name + " is a member of " + Roles.GetRolesForUser().Length + " Roles.<BR>");
Response.Write("User Roles" + "<BR>");
foreach (string role in Roles.GetRolesForUser())
{
Response.Write(role.ToString() + "<BR>");
}
Response.Write("All Roles" + "<BR>");
foreach (string role in Roles.GetAllRoles())
{
Response.Write(role.ToString() + "<BR>");
}
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
How does that allow him to change roles ? Can he add roles and remove them programatically too ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Yes my friend..!
add role
Roles.AddUserToRole(userName, "rolename");
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Take a look at the Roles class[^]
You can create, delete and read roles, as well as adding and removing users to and from roles
For instance, you can show a gridview with all users and a checkboxlist with all the available roles that can be assigned to the selected user
Alexei Rodriguez
|
|
|
|
|
i m confused now...
what to do?? should i use membership or not??
One person's data is another person's program.
--J.Walia
|
|
|
|
|
I would certainly start by using the Membership class, as it hides a lot of the database interaction from you and provides a reasonable basic user management system that works with SQL Sever, mySQL, etc. It includes everything you need to get your head around, including encrypted passwords, user approval, roles, and applications so you can concentrate on your logic, rather than re-inventing the wheel. When you need to extend, then look at deriving from Membership first.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
Hi, thanks for looking, i have a page that is some sort of sitemap, it only lists the links to all my products
I dont want google to show this sitemap as a result, but i want all the pages listed on this page to appear when they are relevant
Will this line make it??
<meta name="Robots" content="NoIndex, Follow" />
Thanks
Alexei Rodriguez
|
|
|
|
|
Hi all,
Couldn't find a regular expression forum so I thought I'd try here as this is for a website.
I'm trying to create a regular expression that I can use to parse through some html generated by a wysiwyg html editor.
Specifically, I am trying to pick up on paths for images so that I can redirect them to a generic handler to use caching etc.
The term I am searching for is like this:
src="/Images/(any expression)"
This value could be anywhere in the text eg:
"This is an example text <img alt="" src="/Images/books_icon.jpg" /> wrapping the value I am searching for."
The best I could come up with was
"^.*?src="/Images/.+?".*?$" but that's picking up too much.
I realise that I need to read up on regular expressions so I've been going through various sites and looking up cheat sheets but I'm hoping someone here can shed some light in the interim.
Thanks in advance!
Got it! "
src="/Images/.+?".*?" Now for a celebratory beer!
JimBob SquarePants
*******************************************************************
"He took everything personally, including our royalties!"
David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager
*******************************************************************
modified on Friday, October 23, 2009 3:58 PM
|
|
|
|
|
Hi
I am trying to add edit and update function to my gridview.
I am using Visual Studio 2008.
I have 3 tables in my database and have a SELECT query which works fine.
I now want to add the edit button to update the database records.
I also have conditional formatting on the results in the gridview.
here are my tables
<br />
USE [SSWorkplan]<br />
GO<br />
<br />
CREATE TABLE [dbo].[Activities](<br />
[ID] [int] IDENTITY(1,1) NOT NULL,<br />
[Activity] [varchar](20) NOT NULL,<br />
CONSTRAINT [PK_Activities] PRIMARY KEY CLUSTERED <br />
(<br />
[ID] ASC<br />
)<br />
<br />
GO<br />
<br />
USE [SSWorkplan]<br />
GO<br />
<br />
CREATE TABLE [dbo].[Employees](<br />
[ID] [int] IDENTITY(1,1) NOT NULL,<br />
[Name] [varchar](50) NOT NULL,<br />
CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED <br />
(<br />
[ID] ASC<br />
)<br />
GO<br />
<br />
USE [SSWorkplan]<br />
GO<br />
CREATE TABLE [dbo].[Data](<br />
[ID] [int] IDENTITY(1,1) NOT NULL,<br />
[Name] [int] NOT NULL,<br />
[Date] [datetime] NOT NULL,<br />
[Slot1] [int] NOT NULL,<br />
[Slot2] [int] NOT NULL,<br />
[Slot3] [int] NOT NULL,<br />
[Slot4] [int] NOT NULL,<br />
CONSTRAINT [PK_Data] PRIMARY KEY CLUSTERED <br />
(<br />
[ID] ASC<br />
)<br />
GO
I added the following test data to the tables
<br />
INSERT INTO [SSWorkplan].[dbo].[Activities]<br />
([Activity])<br />
VALUES<br />
('Sick, Duty', 'Task, Training', '1st Line', 'Meeting', 'Leave',<br />
'Ser Reqs', 'Q Check', '2nd Line', 'Other', 'OOO')<br />
<br />
INSERT INTO [SSWorkplan].[dbo].[Employees]<br />
([Name])<br />
VALUES<br />
('Andrew Woodward', 'Ash Bassett', 'Brian Horan', 'Dalbir Thandi',<br />
'Ismail Patel', 'John Hickenbotham', 'Joby Vaughan', 'Kieron Meadows')<br />
<br />
INSERT INTO [SSWorkplan].[dbo].[Data]<br />
([Name]<br />
,[Date]<br />
,[Slot1]<br />
,[Slot2]<br />
,[Slot3]<br />
,[Slot4])<br />
VALUES<br />
(1, '02/11/09', 5, 5, 5, 5,<br />
2, '02/11/09', 9, 5, 3, 3,<br />
3, '02/11/09', 10, 10, 10, 10,<br />
4, '02/11/09', 7, 7, 7, 7,<br />
5, '02/11/09', 2, 2, 5, 5,<br />
6, '02/11/09', 10, 10, 10, 10,<br />
7, '02/11/09', 10, 10, 10, 10,<br />
8, '02/11/09', 5, 5, 2, 2)
The select statement is
<br />
SELECT Employees.Name, Activities1.Activity AS Slot1, Activities2.Activity AS Slot2, Activities3.Activity AS Slot3, Activities4.Activity AS Slot4, Comments <br />
FROM Data <br />
INNER JOIN Employees ON Data.Name = Employees.ID <br />
INNER JOIN Activities AS Activities1 ON Data.Slot1 = Activities1.ID <br />
INNER JOIN Activities AS Activities2 ON Data.Slot2 = Activities2.ID <br />
INNER JOIN Activities AS Activities3 ON Data.Slot3 = Activities3.ID <br />
INNER JOIN Activities AS Activities4 ON Data.Slot4 = Activities4.ID<br />
Where date = @WPDate
This all works fine upto here.
When I add an Update statement to the datasource and enable editing in the gridview task pane I get the following error.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Incorrect syntax near '.30'.
If I execute the update command whilst in query designer it works fine and updates the database.
Also when the enable editing is set the conditional formatting on the forth row doesn't work.
What am I missing?
This is my final code.
ASPX page
<br />
<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Service Support Workplan Plan" %><br />
<br />
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><br />
</asp:Content><br />
<asp:Content ID="Content2" ContentPlaceHolderID="WorkplanMainContent" Runat="Server"><br />
<br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" <br />
DataSourceID="SqlDataSource1" onrowdatabound="GridView1_RowDataBound" <br />
CssClass="DayGrid"><br />
<Columns><br />
<asp:CommandField ShowEditButton="True" /><br />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" /><br />
<asp:BoundField DataField="08.30-10.00" HeaderText="08.30-10.00" <br />
SortExpression="08.30-10.00" /><br />
<asp:BoundField DataField="10.00-13.00" HeaderText="10.00-13.00" <br />
SortExpression="10.00-13.00" /><br />
<asp:BoundField DataField="13.00-16.00" HeaderText="13.00-16.00" <br />
SortExpression="13.00-16.00" /><br />
<asp:BoundField DataField="16.00-17.00" HeaderText="16.00-17.00" <br />
SortExpression="16.00-17.00" /><br />
<asp:BoundField DataField="Comments" HeaderText="Comments" <br />
SortExpression="Comments" /><br />
</Columns><br />
</asp:GridView><br />
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" <br />
BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" CssClass="calendar" <br />
DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" <br />
ForeColor="#003399" Height="200px" Width="220px"><br />
<SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" /><br />
<SelectorStyle BackColor="#99CCCC" ForeColor="#336666" /><br />
<WeekendDayStyle BackColor="#CCCCFF" /><br />
<TodayDayStyle BackColor="#99CCCC" ForeColor="White" /><br />
<OtherMonthDayStyle ForeColor="#999999" /><br />
<NextPrevStyle Font-Size="8pt" ForeColor="#CCCCFF" /><br />
<DayHeaderStyle BackColor="#99CCCC" ForeColor="#336666" Height="1px" /><br />
<TitleStyle BackColor="#003399" BorderColor="#3366CC" BorderWidth="1px" <br />
Font-Bold="True" Font-Size="10pt" ForeColor="#CCCCFF" Height="25px" /><br />
</asp:Calendar><br />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" <br />
ConnectionString="<%$ ConnectionStrings:SSWorkplanConnectionString2 %>" <br />
<br />
<br />
SelectCommand="SELECT Employees.Name, Activities1.Activity AS '08.30-10.00', Activities2.Activity AS '10.00-13.00', Activities3.Activity AS '13.00-16.00', Activities4.Activity AS '16.00-17.00', Comments FROM Data INNER JOIN Employees ON Data.Name = Employees.ID INNER JOIN Activities AS Activities1 ON Data.Slot1 = Activities1.ID INNER JOIN Activities AS Activities2 ON Data.Slot2 = Activities2.ID INNER JOIN Activities AS Activities3 ON Data.Slot3 = Activities3.ID INNER JOIN Activities AS Activities4 ON Data.Slot4 = Activities4.ID<br />
Where date = @WPDate" <br />
UpdateCommand="UPDATE Data SET Slot1 = @SLOT1, Slot2 = @Slot2, Slot3 = @Slot3, Slot4 = @Slot4, Comments = @Comments WHERE (ID = @ID)"><br />
<SelectParameters><br />
<asp:ControlParameter ControlID="Calendar1" Name="WPDate" <br />
PropertyName="SelectedDate" /><br />
</SelectParameters><br />
<UpdateParameters><br />
<asp:Parameter Name="SLOT1" /><br />
<asp:Parameter Name="Slot2" /><br />
<asp:Parameter Name="Slot3" /><br />
<asp:Parameter Name="Slot4" /><br />
<asp:Parameter Name="Comments" /><br />
<asp:Parameter Name="ID" /><br />
</UpdateParameters><br />
</asp:SqlDataSource><br />
</asp:Content><br />
<br />
Code behind in c#
<br />
using System;<br />
using System.Collections;<br />
using System.Configuration;<br />
using System.Data;<br />
using System.Linq;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.HtmlControls;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Xml.Linq;<br />
<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
<br />
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)<br />
{<br />
<br />
if (e.Row.RowType == DataControlRowType.DataRow)<br />
{<br />
if (e.Row.Cells[1].Text == "1st Line")<br />
{<br />
e.Row.Cells[1].CssClass = "Firstline";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Q Check")<br />
{<br />
e.Row.Cells[1].CssClass = "Qcheck";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "2nd Line")<br />
{<br />
e.Row.Cells[1].CssClass = "Secondline";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Duty")<br />
{<br />
e.Row.Cells[1].CssClass = "Duty";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Leave")<br />
{<br />
e.Row.Cells[1].CssClass = "Leave";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Other")<br />
{<br />
e.Row.Cells[1].CssClass = "Other";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "OOO")<br />
{<br />
e.Row.Cells[1].CssClass = "OOO";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Serv Reqs")<br />
{<br />
e.Row.Cells[1].CssClass = "Serreqs";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Task")<br />
{<br />
e.Row.Cells[1].CssClass = "Task";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Sick")<br />
{<br />
e.Row.Cells[1].CssClass = "Sick";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Meeting")<br />
{<br />
e.Row.Cells[1].CssClass = "Meeting";<br />
}<br />
<br />
if (e.Row.Cells[1].Text == "Training")<br />
{<br />
e.Row.Cells[1].CssClass = "Training";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "1st Line")<br />
{<br />
e.Row.Cells[2].CssClass = "Firstline";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Q Check")<br />
{<br />
e.Row.Cells[2].CssClass = "Qcheck";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "2nd Line")<br />
{<br />
e.Row.Cells[2].CssClass = "Secondline";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Duty")<br />
{<br />
e.Row.Cells[2].CssClass = "Duty";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Leave")<br />
{<br />
e.Row.Cells[2].CssClass = "Leave";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Other")<br />
{<br />
e.Row.Cells[2].CssClass = "Other";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "OOO")<br />
{<br />
e.Row.Cells[2].CssClass = "OOO";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Serv Reqs")<br />
{<br />
e.Row.Cells[2].CssClass = "Serreqs";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Task")<br />
{<br />
e.Row.Cells[2].CssClass = "Task";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Sick")<br />
{<br />
e.Row.Cells[2].CssClass = "Sick";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Meeting")<br />
{<br />
e.Row.Cells[2].CssClass = "Meeting";<br />
}<br />
<br />
if (e.Row.Cells[2].Text == "Training")<br />
{<br />
e.Row.Cells[2].CssClass = "Training";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "1st Line")<br />
{<br />
e.Row.Cells[3].CssClass = "Firstline";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Q Check")<br />
{<br />
e.Row.Cells[3].CssClass = "Qcheck";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "2nd Line")<br />
{<br />
e.Row.Cells[3].CssClass = "Secondline";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Duty")<br />
{<br />
e.Row.Cells[3].CssClass = "Duty";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Leave")<br />
{<br />
e.Row.Cells[3].CssClass = "Leave";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Other")<br />
{<br />
e.Row.Cells[3].CssClass = "Other";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "OOO")<br />
{<br />
e.Row.Cells[3].CssClass = "OOO";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Serv Reqs")<br />
{<br />
e.Row.Cells[3].CssClass = "Serreqs";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Task")<br />
{<br />
e.Row.Cells[3].CssClass = "Task";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Sick")<br />
{<br />
e.Row.Cells[3].CssClass = "Sick";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Meeting")<br />
{<br />
e.Row.Cells[3].CssClass = "Meeting";<br />
}<br />
<br />
if (e.Row.Cells[3].Text == "Training")<br />
{<br />
e.Row.Cells[3].CssClass = "Training";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "1st Line")<br />
{<br />
e.Row.Cells[4].CssClass = "Firstline";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Q Check")<br />
{<br />
e.Row.Cells[4].CssClass = "Qcheck";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "2nd Line")<br />
{<br />
e.Row.Cells[4].CssClass = "Secondline";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Duty")<br />
{<br />
e.Row.Cells[4].CssClass = "Duty";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Leave")<br />
{<br />
e.Row.Cells[4].CssClass = "Leave";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Other")<br />
{<br />
e.Row.Cells[4].CssClass = "Other";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "OOO")<br />
{<br />
e.Row.Cells[4].CssClass = "OOO";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Serv Reqs")<br />
{<br />
e.Row.Cells[4].CssClass = "Serreqs";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Task")<br />
{<br />
e.Row.Cells[4].CssClass = "Task";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Sick")<br />
{<br />
e.Row.Cells[4].CssClass = "Sick";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Meeting")<br />
{<br />
e.Row.Cells[4].CssClass = "Meeting";<br />
}<br />
<br />
if (e.Row.Cells[4].Text == "Training")<br />
{<br />
e.Row.Cells[4].CssClass = "Training";<br />
}<br />
}<br />
}<br />
}<br />
Hope you can help
Andy
|
|
|
|
|
Hi
I am facing a issue on IE browser,I am using a flash file in our .aspx page for showing some events which read a xml file dynamically generated by dataset, problem is that when page is loaded, flash is showing content form xml file but when we change XML file and refresh page again it shown me old xml file value in flash file. but Firefox change on every refresh.
Thanks,
Abbas
modified on Friday, October 23, 2009 12:03 PM
|
|
|
|
|
I checked the detailed output. Here is what I get. Any clue?
Using "ToggleDebugCompilation" task from assembly "C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.Tasks.dll".
Task "ToggleDebugCompilation"
Updating Web.config <compilation> element debug attribute to 'False'.
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error : Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Documents and Settings\pvakil0\Desktop\BestCableDeals\BestCableDeals\Release\web.config line 4)
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: The "ToggleDebugCompilation" task failed unexpectedly.
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: System.ArgumentNullException: Parameter "message" cannot be null.
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowArgumentNull(Object parameter, String parameterName, String resourceName)
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: at Microsoft.Build.Utilities.TaskLoggingHelper.LogMessage(MessageImportance importance, String message, Object[] messageArgs)
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: at Microsoft.WebDeployment.Tasks.ToggleDebugCompilation.Execute()
C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)
Done executing task "ToggleDebugCompilation" -- FAILED.
Done building target "CopyToOutputDir" in project "BestCableDeals.wdproj" -- FAILED.
Done building project "BestCableDeals.wdproj" -- FAILED.
Build FAILED.
please don't forget to vote on the post that helped you.
|
|
|
|
|
1) Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined
Please check this in your webconfig , you should have gotten this error a long time ago, before you even try to publish your Project. remove one entry of that line in the web config.
2)C:\Program Files\MSBuild\Microsoft\WebDeployment\v9.0\Microsoft.WebDeployment.targets(639,7): error MSB4018: The "ToggleDebugCompilation" task failed unexpectedly.
Did you run this Web Deployment project from Visual Studio on server or use MSbuild to run this Web Deployment project file? If it is built in Visual Studio, please set "MSBuild project build output verbosity" option from (Tools menu, click Options, and then select the Projects and Solutions folder and click Build and Run) to get detailed build steps.
In this case, please make sure the process identity that your Web Deployment project is running under has appropriate permission, especially the location where the Output will be.
3)For other Errors look at this
http://blogs.msdn.com/clichten/default.aspx?p=3[^]
That is why i setup project to deploy my applications.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hi
to print a page ,i used javascript
and it is sucussefuly printing the page
but the problem is
the site address is also displayed while printing
at the bottom of the page
i dont need to display the site address while printing the page
is it possible
thanks in advance
vijay kumar D
|
|
|
|
|
i presume when you say at the bottom you mean the status bar of your page. Ok if you want to change the status bar when you are printing , add an empty string to the status bar or display a message if that does not bother you .
window.status='...';
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
hi
thank you so much
similarly can i make null
title
pageno
date
|
|
|
|
|
try it but you might get
object not set for an instance of a class error, so its better to keep it as an empty string
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
There are option given to the client while he prints the page to omit those I think.
By default it comes with all those in IE.
|
|
|
|
|
All -
I am trying to create a simple app that will capture emails and when my users try to remove their email from the db they get an error. Here is my ASP code:
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/App_Data/mail.mdb"
DeleteCommand="DELETE FROM [Email] WHERE (([Email] = ?) OR ([Email] IS NULL AND ? IS NULL))"
InsertCommand="INSERT INTO [Email] ([Email]) VALUES (?)"
OldValuesParameterFormatString="original_{0}"
SelectCommand="SELECT [Email] FROM [Email]">
<DeleteParameters>
<asp:ControlParameter ControlID="txtEmail" Name="original_Email"
PropertyName="Text" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Email" Type="String" />
</InsertParameters>
</asp:AccessDataSource>
Here is the code below:
protected void btnSubscribe_Click(object sender, EventArgs e)
{
AccessDataSource1.InsertParameters["Email"].DefaultValue = txtEmail.Text;
try
{
AccessDataSource1.Insert();
txtEmail.Text = "";
lblError.Text = "Email sucessfully added";
}
catch
{
lblError.Text = "Email already exists";
}
}
protected void btnUnSub_Click(object sender, EventArgs e)
{
AccessDataSource1.DeleteParameters["Email"].DefaultValue = txtEmail.Text;
try
{
AccessDataSource1.Delete();
txtEmail.Text = "";
lblError.Text = "Email has been removed";
}
catch
{
lblError.Text = "Email doesn't exist";
}
}
Thanks for all your help
|
|
|
|
|
When you post in CodepProject use the Pre tags, there is a Tool bar for you. This will make us keen to help you. Formating in important.
Your Delete is not Correct
DELETE FROM [Email] WHERE (([Email] = ?) OR ([Email] IS NULL AND ? IS NULL))
the Syntax Supposed to be
DELETE TABLENAME WHERE [Email] = ? OR [Email] IS NULL
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
|
Welcome
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi All,
plz tell me Multi level marketing mlm asp.net Tree structure logic.
|
|
|
|
|
|
Well, add some top level nodes, then the next level down and so on. Whats so difficult?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
add some top level nodes, then the next level down and so on.Is very easy but how can we show it visually in asp.net
|
|
|
|
|