|
Hi,
A session will be available as long as that user is using the site. No matter the page. So it’s clear that your session is available. By default, session variables are stored in memory. What I suggest you is, first in your web site find what is the setting you have given for the session state mode. It should be “InProc” to store the session in the memory. This could be found in Web.Config.
<sessionState mode="InProc"></sessionState>
Thx,
Gayani
|
|
|
|
|
I have to write a classic ASP page.I have a page which has a html table with some row , each row has some controls with several textboxes and 3 select controls(dropdownlist). At table's below, there is a Add button to add new row. When click on Add button, the new row will be added(with full of textboxes and select controls as same to other rows, and they have the same ID, too). What I wanna do is after selected an item from the first dropdownlist, data will be loaded from server and filled in the second dropdownlist on the same row, and after selected an item from the second one, data will be loaded form server to fill in the third one. I wonder after select an item from the first dropdownlist, I need to reload page to load data and fill the second one, and if I have some rows already has been filled data in textbox control etc will be lost. To resolve it, I've tried to use AJAX technology but It didn't work with IE though that worked with Firefox. Please help me to resolve this problem? If you can show me code better.
<![CDATA[<%@ LANGUAGE="VBSCRIPT"%>]]>
<![CDATA[
<![CDATA[
<html>
<head>
<title>Add a row in table</title>
</head>
<script language="javascript">
function InsertRow()
{
count++;
var table = document.getElementById("tblAddRow");
if (!table) throw "Table not found";
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
var cell4 = row.insertCell(3);
cell1.innerHTML = 'Test' + count;
cell2.innerHTML = '<input type="text" id="txtDate">';
cell3.innerHTML = '<select id="cboCompany" name="cboCompany" onchange="javascript:ShowPermission(this, this.value);">' +
'<option value="0">????</option>' +
'<% Do while Not rs.EOF %>' +
'<option value="<%=rs(0)%>"><![CDATA[<%=rs(1)%>]]></option>' +
'<% rs.MoveNext() %>' +
'<% Loop %>' +
'</select>';
cell4.innerHTML = '<select id="cboPermission" name="cboPermission">' +
'<option>????</option>' +
'</select>';
}
</input></script>
<body>
<form name="frmAddRow" action="" method="post">
<table id="tblAddRow" border="1">
<tr>
<td>Colum1</td>
<td>Colum2</td>
<td>Colum3</td>
<td>Colum4</td>
</tr>
</table>
<input type="button" name="btnAddRow" onclick="javascript:InsertRow();" value="AddRow" />
</form>
</body>
</html>
<![CDATA[
modified on Tuesday, July 1, 2008 3:10 AM
modified on Tuesday, July 1, 2008 3:13 AM
|
|
|
|
|
My code:
foreach ( strSuggestion in functionReturnValue)
{
dblSimilarity = WordSimilarity(strWord, strSuggestion);
i = intSuggestionCount;
while (dblSimilarity > dblSimilarityArray(i)) {
if (i < intSuggestionCount) {
strSuggestionArray(i + 1) = strSuggestionArray(i);
dblSimilarityArray(i + 1) = dblSimilarityArray(i);
}
Error:Type and identifier are both required in a foreach statement
|
|
|
|
|
You need to specify the type of strSuggestion in this case I assume is string
like
foreach (string strSuggestion in functionReturnValue)
{
dblSimilarity = WordSimilarity(strWord, strSuggestion);
i = intSuggestionCount;
while (dblSimilarity > dblSimilarityArray(i)) {
if (i < intSuggestionCount) {
strSuggestionArray(i + 1) = strSuggestionArray(i);
dblSimilarityArray(i + 1) = dblSimilarityArray(i);
}
|
|
|
|
|
I Want to store Data in Hindi Language in MS SqlServer by admin of site.Now I want to show this data in ASP.NET Control (like Label,TextBox).
Please help me.
Thanks
Vishal
Vishal Rastogi
|
|
|
|
|
You have to use NVarchar which can keep unicode characters.
|
|
|
|
|
|
d@nish wrote: you can set font as 'Mangal'.
But user need to download this, right ? Unicode is always better than this as it will be displayed correctly when browser encoding is in UTF8.
|
|
|
|
|
Agreed.
Got my five
|
|
|
|
|
Thanks
|
|
|
|
|
Hello friend,
I have specefied Font-Names="Mangal" on textbox control in asp.net, but still at runtime on entering some text on it, it is displaing text in english.
Please help me to enter and find text in hindi.
nikki
|
|
|
|
|
Hi,
I using ASP.NET with C#, how can i get Active Directory from my server?
Socheat
|
|
|
|
|
using System.DirectoryServices;
and use DirectoryEntry and DirectorySearcher Class.
if you have any doubts you can ask me !!!
|
|
|
|
|
Can you give a full example?
Socheat
|
|
|
|
|
create connection
public static DirectoryEntry GetDirectoryEntry()<br />
{<br />
DirectoryEntry de = new DirectoryEntry();<br />
de.Path = LDAP:
de.Username = @"yourdomain\sampleuser";<br />
de.Password = "samplepassword";<br />
return de;<br />
}
Click Here For details
Active Directory .NET[^]
|
|
|
|
|
|
I have a web control (btnClose) for close the application. And I have wrtn. the flg. js. in my page load.
btnClose.Attributes.Add("onClick", "window.close();")
If I click close btn., I'm getting msg. such as "Do u want to close the window Y or N?" without post back. If I click yes, it is geting closed. But If I click no, at that time only, my page is getting post back. How to avoid this post back, even when I click 'No'.
Balasubramanian K.
|
|
|
|
|
Try this:
btnClose.Attributes.Add("onClick", "return window.close();")
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
No. Post back is happening if I click 'No'. Is there any other idea?
Balasubramanian K.
|
|
|
|
|
I modified html button istead of web control button. Now It is working well without any post back. Tnx for your effort.
Balasubramanian K.
|
|
|
|
|
use return false after .close();
|
|
|
|
|
Heelo experts
i have to display reservations of vehicle in html table as displayed visullay like schedule General control or like outlook .
i have to use html table for display reservations .
i have to set start_of_displaytime and end_of_diplay_time of reservations .
any help or article is highyly appercaited please iam stuck on this from month or so.
Rameez
|
|
|
|
|
Hi,
First of all, im not really sure whether you are getting data in the forum of a dataset. And I would like to know, why you want to stick to the html table.
For the HTML Table : What is suggest is, you could construct the table and add the table an ASP.NET Panel control.
Another way of doing :Or else if you go for some thing like a GridView or DataList control, we could directly bind the values. Let me know whot exactly you want, I will guide you with this.
Thx,
Gayani
|
|
|
|
|
Thank you very much Gayani Devapriya ,
iam very thank ful for you for help.
Actualy i have to display reservations visullay like
"http://www.codeproject.com/KB/custom-controls/schedule.aspx"
in above link there is General schedular control i want to design some thing like this .
can u send me your email ID as i can send u code script for testing becuase iam new in this filed and iam stuck on this from last month .
your help is highly appericated .
regards
Rameez
|
|
|
|
|
Hi,
My email is gayani.devapriya@gmail.com, but Im sorry to say that I cannot access private mails account from my office. So Ill just stick to the Code Project Forum for the time being.
I justed looked at the sample link given. First of all I need to know for whot sort of a object you get the data from the database. ie; innitialy are you getting it to a Dataset or a Collection?
I will show a simple example using a Dataset.
DataSet dsSchedule = GetMySchedule();
This wil have a structure like
Channel, Time, Program
C1 T1 P1
C2 T2 P2
C1 T3 P3
Now you want it to look like
Channel T1 T2 T3
C1 P1 NA P3
C2 NA P2 NA
1. Create a Panel where you want this table to be.
2. Now we will create a table dynamically.
Table tblDetails = new Table();
2.1. Create Table headers.
TableRow trHeader = new TableRow();
2.1 Now lets add cell by cell.
Create the first cell to represnt the Channel.
TableHeaderCell thcChannel = new TableHeaderCell();
thcChannel.Text = "Channel";
trHeader.Cells.Add(thcChannel);
Now for the other header cells, write a method to get all the Times(T).
Lets say you get all the times(T1,T2) to a List. List<string> times = new List<string>();
times = //Write a method to retrive all times.
traverse the list now using for each and assign each time(T) to the cell's Text property, and add the cell to the row, as explained above.
And add the header to the table
tblDetails.Rows.Add(trHeader);
By now your table header will be complete.
2.2. Lets create rows now.
First cell of the row should have the channel name(ex : C1, C1), while others with the program names(ex : P1, P2)
The initial dataset dsSchedule will have all these data.
foreach(DataRow dr in dsSchedule.Table[0].Rows)
{
TableRow trData = new TableRow();
TableCell tcChannel = new TableCell();
tcChannel.Text = dr["Channel"].ToString();
trData .Cells.Add(tcChannel);
Now for each channel and time we need to get the value, so you may filter your dataset as follows.
foreach(string sTime in times)
{
string sCurrentChannel = dr["Channel"].ToString();
string sCurrentTime = sTime;
DataView dv = ds.Tables[0].DefaultView;
dv.RowFilter = "Channel == '" + sCurrentChannel + "' & Time == '" + sCurrentTime + "'";
DataTable dt = dv.ToTable();
string sProgram = string.Empty;
if (dt == null)
{
sProgram = "NA";
}
else
{
sProgram = dt.Rows[2].ToString();
}
TableCell tcProgram = new TableCell();
tcProgram .Text = sProgram;
trData.Cells.Add(tcProgram );
}
tblDetails.Rows.Add(trData);
}
Now all your data should be there.
3. Add the table to the Panel
pnlSchedule.Controls.Add(tblDetails);
Hope its clear..
Thx,
Gayani
|
|
|
|