|
|
Dear All,
I am encountering a wierd behaviour,when writing a Server control where the namespace of the control starts with Style. Please clarify if I am doing something wrong or if I use any reserved keywords?
Issue details are below
1) Create a custom control using the following code
namespace Style.Enum //you can have any namespace which stars with Style.
{
public class EnumClass
{
public enum SomeEnumType
{
TYPE1,
TYPE2
}
}
public class ServerControl : WebControl
{
private EnumClass.SomeEnumType eType;
public ServerControl()
{
}
public EnumClass.SomeEnumType ETYPE
{
get
{
return eType;
}
set
{
eType = value;
}
}
}
}
2) Now add this control in a web page. (sample code)
<%@ Register Assembly="StyleEnum" Namespace="Style1.Enum" TagPrefix="cc1" %>
...
...
<cc1:ServerControl ID="ServerControl1" runat="server" ETYPE="TYPE2" Width="202px" />
3) Now you will get an error as below
Error 1 'System.Web.UI.WebControls.Style' does not contain a definition for 'Enum' X:\XXX/XXXXXX\EnumIssue.aspx
4) If you modify your code with namespace Style1.Enum and other related codes..., you can avoid this issue....
For the past two days, sleeplesly I am verifying all my codes and finally this issue seems something I am not able to understand the reason (according to me I am doing right here.).
Changing the namespace in my application is a bit tough job, as there is a lot of dependency on namespace
Happy Coding,
A.Sivakumar
|
|
|
|
|
can any body guide me how can i set session timeout in my web.config???
i have written following statement and it is not working actually my requirement is if session timeout then page should be redirected to login page how is it possible????
<system.web>>
<sessionstate mode="InProc" timeout="1">
umerumerumer
|
|
|
|
|
Your web.config section did not appear in the message.
What you can do is to use a base page, or master page. Set a session variable such as username when the user logs on.
In the page load of your base page or master page check to make sure the session variable is not null.
If it is null, redirect the user to the log on.
Also you might want to put a javascript timer on the page so that it will warn the user if he is idle for 20 min.
I didn't get any requirements for the signature
|
|
|
|
|
<system.web>
<sessionState mode="InProc" timeout="30"/>
|
|
|
|
|
I have a pop-up window that gets displayed after a button has been evoked on the parent window.
The pop window contains an img with text that conveys to the user that the current file is downloading and an iframe.
The iframe does the bulk of the work ... it populates a infrigistics grid that inturn populates an xls document that gets compressed ... and so forth ... however the problem arises when one wants to navigate to another page from the parent page... it takes long to load another page.
It's very confusing what is the relationship beween a popup window and it's parent ... maybe this will aid me in deducing a solution
|
|
|
|
|
i am using Crystal report with asp.net 3.5...
it load sucessfully and displays records in it but when i click on any record it gives me error logon failure can any body please guide me where is the problem????
if it logon first time then why it gives error after clicking on it... i have applied postback checks but all in vain....
umerumerumer
|
|
|
|
|
Hello,
I just finished a web application which works fine with IE7. But clicking on the login button in Firefox does nothing. No errors. I need to know what the problem is. Thanks in advance...
Obinna, Nigeria.
//obinnaaj Eof
|
|
|
|
|
|
here's the main section of my code on the signonform.aspx.cs file:
string fromDbase = loginDset.Tables[0].Rows[0]["PASSWORD"].ToString();
bool comparisonSucceeded = Cryptographer.CompareHash("SHA256Managed", password, fromDbase);
string userCode = loginDset.Tables[0].Rows[0]["USER_CODE"].ToString();
DataSet personalDset = new DataSet();
personalDset = dl.DIMS_GetDimsUSers(userCode, ref msg);
if (msg != string.Empty)
{
relayBox.Text = "errormsg";
msgBox.Text = "DIMS Error 399: Could not retrieve all DIMS users";
return;
}
if (comparisonSucceeded)
{
Session["auditNo"] = Session.SessionID;
string operation = "LOG IN";
dl.DIMS_InsertAuditTrail(Session["auditNo"].ToString(), personalDset.Tables[0].Rows[0]["NAME_OF_LECTURER"].ToString(), personalDset.Tables[0].Rows[0]["USER_CODE"].ToString(),operation.Trim(), ref msg);
relayBox.Text = "welcome";
return;
}
thanks again!
//obinnaaj Eof
|
|
|
|
|
You'll have to provide more information, such as what the code is doing.
|
|
|
|
|
here's the main section of my code on the signonform.aspx.cs file:
string fromDbase = loginDset.Tables[0].Rows[0]["PASSWORD"].ToString();
bool comparisonSucceeded = Cryptographer.CompareHash("SHA256Managed", password, fromDbase);
string userCode = loginDset.Tables[0].Rows[0]["USER_CODE"].ToString();
DataSet personalDset = new DataSet();
personalDset = dl.DIMS_GetDimsUSers(userCode, ref msg);
if (msg != string.Empty)
{
relayBox.Text = "errormsg";
msgBox.Text = "DIMS Error 399: Could not retrieve all DIMS users";
return;
}
if (comparisonSucceeded)
{
Session["auditNo"] = Session.SessionID;
string operation = "LOG IN";
dl.DIMS_InsertAuditTrail(Session["auditNo"].ToString(), personalDset.Tables[0].Rows[0]["NAME_OF_LECTURER"].ToString(), personalDset.Tables[0].Rows[0]["USER_CODE"].ToString(),operation.Trim(), ref msg);
relayBox.Text = "welcome";
return;
}
thanks again!
//obinnaaj Eof
|
|
|
|
|
Hi. I want to disable navigation button or some date ranges form AJAX Control Toolkit's Calendar Extendar. Can any one help me?
|
|
|
|
|
|
After executing sql script (which include my custom tables and aspnetdb tables, views, stored procedures required for roles n membership) i m getting this error when i m trying to create user through asp.net createuserwizard control
The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
all i did create new DB and execute the script so i can have tables to work but getting error Plz Help.
Thanks in advance.
|
|
|
|
|
i want to create widgets in asp.net 2.0 not using 3.0 or 3.5.
plz guide me how to accomplish widgets?
|
|
|
|
|
|
iam createing website with asp.net
and i want make rss feed and i don`t know how can i make this ??
plz any body give me the way to make dynamic rss feed to get the newest data from data base ???
plz can i body help me ???
|
|
|
|
|
Hi , m Create A UserDefined funtion in sqlserver 2000 ,
And Want to use this in Asp.net ;
I use Stored Procedure 4 this by this code but......
CREATE PROCEDURE [dbo].[spShow_Total_Holiday_In_Current_Month]
@day varchar(100)
AS
select dbo.fnGetDatesforAday('10/01/2008','10/31/2008' , @day)GO
But this shows error
"Invalid object name 'Attandance.dbo.fnGetDatesforAday' "
tell me how can i solve this .
Thanx
|
|
|
|
|
Hi i hope you don't have the function dbo.fnGetDatesforAday. so that u got the error. If u run the query manually in your DB server you will get the same error.
"select dbo.fnGetDatesforAday('10/01/2008','10/31/2008' , @day) Go".
|
|
|
|
|
You will get the result if you create the below fuction in your DB server.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: To Get any weekday dates between two dates
-- =============================================
CREATE FUNCTION fnGetDatesforAday
(
-- Add the parameters for the function here
@DtFrom DATETIME,
@DtTo DATETIME,
@DayName VARCHAR(12)
)
RETURNS @DateList TABLE ([Day] varchar(20),Dt datetime)
AS
BEGIN
IF NOT (@DayName = 'Monday' OR @DayName = 'Sunday' OR @DayName = 'Tuesday' OR @DayName = 'Wednesday' OR @DayName = 'Thursday' OR @DayName = 'Friday' OR @DayName = 'Saturday')
BEGIN
--Error Insert the error message and return
INSERT INTO @DateList
SELECT 'Invalid Day',NULL AS DAT
RETURN
END
DECLARE @TotDays INT
DECLARE @CNT INT
SET @TotDays = DATEDIFF(DD,@DTFROM,@DTTO)-- [NO OF DAYS between two dates]
SET @CNT = 0
WHILE @TotDays >= @CNT -- repeat for all days
BEGIN
-- Pick each single day and check for the day needed
IF DATENAME(DW, (@DTTO - @CNT)) = @DAYNAME
BEGIN
INSERT INTO @DateList
SELECT @DAYNAME,(@DTTO - @CNT) AS DAT
END
SET @CNT = @CNT + 1
END
RETURN
END
GO
|
|
|
|
|
Thanx . but i create the same Function it works fine , but when i call this function under stored Procedure then it show error .
|
|
|
|
|
Hi All,
Can u please help how to convert .flv file to .wmv file using c#.net ???
Thanks in Advance.
|
|
|
|
|
No. Ask in the right place, and ask Google first.
|
|
|
|
|
How to validate a file upload control for file types
|
|
|
|