Hi Nedash,
You need to update your SP as below,.
DECLARE @tbl TABLE
(
Id INT
,Name VARCHAR(50)
,Behcode VARCHAR(50)
,Password VARCHAR(50)
,T_name VARCHAR(50)
)
INSERT INTO @tbl
SELECT 1, 'Sara', '1111' ,'1212' ,'Store'
UNION ALL
SELECT 2, 'Jack' ,'2222' ,'4545' ,'Estate'
--------------------------------------
-- INPUT PARAMETERS
DECLARE @Behcode VARCHAR(50),
@PassWord VARCHAR(50)
SELECT @Behcode = '1111', @PassWord = '1212'
--------------------------------------
DECLARE @RedirectionPage VARCHAR(50)
SELECT @RedirectionPage = (CASE WHEN T_name = 'Store' THEN 'Manager.aspx' WHEN T_name = 'Estate' THEN 'Estate.aspx' ELSE NULL END) FROM @tbl
WHERE Behcode = @Behcode AND [Password] = @PassWord
SELECT @RedirectionPage
- Here you will get Page Name so use string.Format in
Response.Redirect("Managers.aspx?BehCode=" + Server.UrlEncode(Txtbeh.Text));
above line of code, but before that check for string.IsNullOrEmpty()
- Update your this event accordingly.
Thanks and Regards,
Rk_Hirpara