|
how we can set and unset or destory sesstion?
|
|
|
|
|
Buy a book on ASP.NET and read it. This is such an entry level question that even tho I will answer it, it's clear you have a lot to learn.
Session["MyKey"] = "value"; // can be any type
string s = (string)Session["MyKey"];
Session["MyKey"] = null;
I would put the keys into a class, so that you're not always typing them, the compiler will not find typos in there. Also, I'd add methods to a base page class that safely check if a session object is null and return a bool if it is, just like the tryparse methods on classes like string.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
how about
Session.Abondon();
|
|
|
|
|
Well, I presume that clears it all, I was showing how to clear one value only.
Christian Graus
Please read this if you don't understand the answer I've given you. If you're still stuck, ask me for more information.
|
|
|
|
|
Hi,
I have developed one user control,i have written most of the functionality on that control, just i have added that to the aspx page, in the ASCX, i have loaded dyamic controls like checkboxes, labels... based on the Checkbox selection, i want some DDL operations(Edit, Create Delete), on database in the button click. in the button click i want checkbox ID, to find which box is selected. i am not getting that ID. Please help me if any one knows.
Thanking you
|
|
|
|
|
dwadasi wrote: i have loaded dyamic controls like checkboxes,
The problem may be because of that.
dwadasi wrote: based on the Checkbox selection, i want some DDL operations
Why cant you write a property for that?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Hi,
I do not have my website URL in my wwwroot folder, but some where on my C drive. How do I get the root path of where my website resides?
Thanks
Brendan
|
|
|
|
|
|
.NET Enthusiast wrote: How do I get the root path of where my website resides?
Server.MapPath("/") gives the root path for that server.
|
|
|
|
|
.NET Enthusiast wrote: How do I get the root path of where my website resides?
Server.MapPath("~")
gives you the root folder of your application.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
how to work with .net and Flex.
I am very new for flex so please give me some Help for starting Flex and .net communication Steps.
Thanks
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Piyush Vardhan Singh wrote: I am very new for flex so please give me some Help for starting Flex and .net communication Steps.
Here is one article to upload multiple file using flex and .net.
Visit Click Here
Regard
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Thanks For reply
I am talking about this flex just i want to use my .net dll in flex.
Link:-
http://www.themidnightcoders.com/weborb/dotnet/[^]
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
how to select a range of text of a text box , i have the start and end point. but i want that as seleced ?
please help !!!
element.selectionStart = start; element.selectionEnd = end;
now i want to selct that area.
cheers,
Abhijit
|
|
|
|
|
Try this
<br />
var txtRange = txtBox.createTextRange();<br />
txtRange.moveStart("character", start);<br />
txtRange.moveEnd("character", end);<br />
txtRange.select();<br />
txtBox.focus();<br />
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Sherin Iranimose wrote: txtRange.moveStart("character", start);
txtRange.moveEnd("character", end);
what about this "character" ?
i am having following Text in a text box
"test1;test2;test3;test4";
now i have clicked on test2. i am getting first postion of test2 and last postion.
now i want to select that one . just for delete as in outlook text box.
Thanks for ans !!!
cheers,
Abhijit
|
|
|
|
|
"character" is to specify, Moves one or more characters.
We can use "word","sentence","textedit".
Look Here[^]
Abhijit Jana wrote: now i have clicked on test2. i am getting first postion of test2 and last postion.
now i want to select that one .
Do you want to do this? OR already Done?
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
modified on Monday, July 7, 2008 9:46 AM
|
|
|
|
|
Sherin Iranimose wrote: Do you want to do this? OR already Done?
i have alredy done !! i just need to select that area .
cheers,
Abhijit
|
|
|
|
|
Hi, i have done this in this way.
rng=elem.createTextRange();<br />
rng.findText(val.substring(start,end));<br />
rng.select();
Thanks for your help !!!
cheers,
Abhijit
|
|
|
|
|
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
but i am geeting 1 problem,if there is same entry , first one is selected
any idea !!!
cheers,
Abhijit
|
|
|
|
|
You must rewrite the logic of finding the "start" and "end".
EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE.
|
|
|
|
|
Hi,
I am newbie to asp.net C#, so I am not sure how to read the data from SQL Express database and validate the user input from the database using asp.net C#. Mostly from book and internet are in VB language. I don't want use login control in asp.net C#. The below is I create the main page myself. In vb,I am ok with it but C# not good.
Anyone can help and any recommended website for asp.net C#?
The bottom is my source code where I have tried to use SQLdataReader:
aspx
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Navigation" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Footer" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" runat="server"
contentplaceholderid="RightTopContent">
<asp:Image ID="Image1" runat="server" Height="26px" Width="162px" />
<br />
Username :<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
<br />
Password :<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnSubmit" runat="server" onclick="btnSubmit_Click"
Text="Login" />
<br />
</asp:Content>
<asp:Content ID="Content6" runat="server"
contentplaceholderid="RightMiddleContent">
</asp:Content>
<asp:Content ID="Content7" runat="server" contentplaceholderid="MainContent">
</asp:Content>
aspx.cs
protected void btnSubmit_Click(object sender, EventArgs e)
{
string uname = txtUserName.Text;
string pwd = txtPassword.Text;
string connectionString = "Data Source= .\\SQLEXPRESS;"
+ "AttachDbFilename=\"C:\\Documents and Settings\\kathy\\My Documents\\Visual Studio 2008\\WebSites\\WebSite1\\App_Data\\salon.mdf\";"
+ "Integrated Security=True;"
+ "User Instance=True";
SqlConnection myConnection = new SqlConnection(connectionString);
SqlCommand cmd = myConnection.CreateCommand();
cmd.CommandText = "SELECT * FROM [Customer]";
myConnection.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
if (dr.GetOrdinal("UserName").ToString() == txtUserName.Text)
{
Response.Write("Heelo");
//dr.Close();
}
//dr.Close();
myConnection.Close();
}
|
|
|
|
|
Check out the <asp:Login /> control (and related), with the only really important event the Authenticate event.
-Domenic Denicola-
|
|
|
|
|
I really can't figure this one out; sorry guys.
I have a pretty-standard WCF service, with a contract something like this:
[ServiceContract(Namespace="http://www.domenicdenicola.com/")]
public interface IMyService
{
[OperationContract]
[WebInvoke]
void PerformBigOperation();
[OperationContract]
[WebInvoke]
int GetProgress();
}
I generate the ASP.NET AJAX proxy class in the usual way:
<asp:ScriptManager ID="ScriptManager" runat="server">
<Services>
<asp:ServiceReference Path="MyService.svc" />
</Services>
</asp:ScriptManager>
I then call them from JavaScript like so:
var service = new www.domenicdenicola.com.IMyService();
function UpdateProgress()
{
service.GetProgress(function onSuccess(result)
{
$get("Status").innerHTML = result + " % complete…";
setTimeout(UpdateProgress, 1500);
});
}
function PerformBigOperation()
{
setTimeout(UpdateProgress, 1500);
service.PerformBigOperation(function onSuccess(result)
{
$get("Status").innerHTML = "Done.";
});
} where PerformBigOperation is called upon clicking a button, and Status is the ID of a status <p /> tag.
I also have set Async="True" in my <%@ Page %> directive. (This seems to make no difference.) My web.config contains the following relevant sections:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<extensions>
<behaviorExtensions>
<add name="enableWebScript" type="(a long string)"/>
</behaviorExtensions>
<bindingExtensions>
<add name="webHttpBinding" type="(a long string)"/>
</bindingExtensions>
</extensions>
<bindings>
<webHttpBinding/>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="1000" maxConcurrentSessions="1000"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Behavior" name="MyService">
<endpoint address="" binding="webHttpBinding" behaviorConfiguration="EndpointBehavior" contract="IMyService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
The problem is, the first call to the service blocks the second one, so GetProgress never returns until after PerformBigOperation is finished, by which point it is, of course, useless. Any ideas!?!
-Domenic Denicola-
|
|
|
|