asp.net logout user
FormsAuthentication.Signout();
Response.Resirect([loginURL]);
Achievement provides the only real pleasure in life
FormsAuthentication.Signout();
Response.Resirect([loginURL]);
Posted by
SF
at
10:03 am
0
comments
DECLARE @tempTable table(Id INT NOT NULL PRIMARY KEY)
DECLARE @counter INT
INSERT INTO @tempTable SELECT UserId from TestTable
SET @counter = 1
WHILE (@counter < (SELECT COUNT(UserId) FROM @tempTable)+1)
BEGIN
UPDATE TestTable SET TestColumn = '' WHERE Id = (
SELECT a.Id FROM
(SELECT Id, Row_Number() OVER(ORDER BY UserId) AS 'RN' from TestTable) as a
where a.RN = @counter
)
SET @counter = @counter + 1
END
Posted by
SF
at
10:50 am
0
comments
This is because the detail table is set to "visible=false" during the update process. Not all RadGrid controls in the application get this symptom, not sure why this happens. All you need to do is to change the setting to "visible = true"
Posted by
SF
at
10:58 am
0
comments
I came cross this this issue of failing to do a division with 2 integer values. Stupid enough......
so In order for the division to work i used CAST(value TO FLOAT)
Posted by
SF
at
9:51 am
0
comments
int tempId= 168;
RadWindow rw = rwmTEMP.Windows[0];
rw.Width = System.Web.UI.WebControls.Unit.Pixel(1000);
rw.Height = System.Web.UI.WebControls.Unit.Pixel(1000);
rw.Behaviors = WindowBehaviors.Move | WindowBehaviors.Close | WindowBehaviors.Maximize | WindowBehaviors.Resize;
rw.OpenerElementID = btnOpenWindow.ClientID;
rw.NavigateUrl = "~/xxxxx/abccc.aspx?TempId=" + tempId.ToString();
Posted by
SF
at
1:27 pm
0
comments
use the combination of &,#,10, and ; to create a new line
Posted by
SF
at
10:26 am
1 comments
the following script resets the table identity seeding to 99, the next record will have identity of 100
DBCC CHECKIDENT ("[table name]", RESEED, 99);
GO
Posted by
SF
at
1:54 pm
0
comments
use master alter database DatabaseName set offline with rollback immediate
Posted by
SF
at
2:31 pm
0
comments
update Table1
SET StartDateTime = CONVERT(datetime,
CONVERT(VARCHAR(10),StartDateTime , 101)
+' '+CONVERT(VARCHAR,datepart(HH,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(MI,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(SS,NewStartTime))
+':'+CONVERT(VARCHAR,datepart(Ms,NewStartTime))
)
Posted by
SF
at
11:40 am
0
comments
I have 2 datetime values: StartDateTime ('11/01/2010 00:00:00') and NewStartTime('12/02/2010 09:30:00 AM'). I want to replace the time value in StartDateTime with the time value in NewStartTime. In order to achieve so I go:
DateTime NewStartDateTime = new DateTime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, NewStartTime.Hour, NewStartTime.Minute, NewStartTime.Second);
Posted by
SF
at
3:56 pm
0
comments
this is caused by using "Request["xxx"]"
a quick fix is to use "HttpContext.Current.Request" instead
Posted by
SF
at
12:49 pm
0
comments
Update TableA
set ColumnA1 = (select a.ColumnA from
(
"SELECT" REPLACE("t.ColumnA1, t.ColumnA2", (select "ColumnB1 from TableA where ColumnB2= t.ColumnA2))
FROM TableA t
) a
where TableA.ColumnA2 = a.ColumnA2)
GO
Posted by
SF
at
6:10 pm
0
comments
RadMenu1.FindItemByText("RadMenuItem1").Visible = false;
Posted by
SF
at
9:57 am
1 comments
Edit Mode:
"if"(!RadScheduler1.StartEditingInAdvancedForm)
Insert Mode:
"if"(!RadScheduler1.StartInsertingInAdvancedForm)
Posted by
SF
at
2:50 pm
0
comments
code:
"Response".Clear();
"Response".AddHeader("content-disposition", "attachment;filename=" + FileName + ".txt");
"Response".Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
"Response".ContentType = "application/vnd.text";
"StringWriter" stringWrite = new StringWriter();
"HtmlTextWriter" htmlWrite = new HtmlTextWriter(stringWrite);
"Response".Write(strTXTFileBuilder.ToString());
"Response".End();
Error:
Internet Explorer cannot download file
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.
My Solution:
Take out the line "
Posted by
SF
at
3:48 pm
0
comments
'if' not 'exists' (select .... from .... where ....)
Begin
'Insert' Into ....... (..., ..., ...) values (..., ..., ...,)
END
Posted by
SF
at
2:26 pm
0
comments
in the Parent page add into the radwinow aspx code:
sas"<"telerik:radwindow id="rwpopup111" title="popup111" runat="server" behaviors="Close" onclientclose="OnClientClose" navigateurl="popup111.aspx">
also add javascript:
function OnClientClose(oWnd)
{
//place your code to execute, see below for my examples, in this example I rebind a grid:
var hf111 = document.getElementById("");
var masterTable1 = $find("").get_masterTableView();
masterTable1.rebind();
var masterTable = $find("").get_masterTableView();
masterTable.rebind();
//after radwindow close you may lose title of the parent page, if that is the case reset it here:
document.title="abc";
}
Posted by
SF
at
12:29 pm
0
comments
rw.Width = Unit.Pixel(800);
rw.Height = Unit.Pixel(600);
rw.Behaviors = WindowBehaviors.Move & WindowBehaviors.Maximize & WindowBehaviors.Close;
Posted by
SF
at
3:21 pm
0
comments