|
sir,
i want to develop a program based on user login and logout. i want to know the proper timing about the user login and user logout.
I want that a file to be created whenever the user logins, and whenever the user logs out i want to delete that file after 20 minutes i.e. the file about the session of the user expires after 20 minutes.
Can you plz. send me the project about the above said problem.
thanks
|
|
|
|
|
u can use cookies for that and set the expiring time of the cookies to 20 minutes. Then the user will be able to log for 20 minutes.
Sandy
-- modified at 1:03 Monday 8th May, 2006
|
|
|
|
|
sir,
can u send me any link please.
Thanks
|
|
|
|
|
|
I want to pass a(numerical) value from a dropdownlist to an SQL select using the DropDownList SelectedIndexChanged event.
Here's my code so far.
protected void MyDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList MyDropDownList = (DropDownList)("MyDropDownList");
MyLabel.Text = MyDefinitionDropDownList.SelectedItem.Value.ToString();
string strSQL;
strSQL = "SELECT COUNT(*) as count from MyTable where ID= ???";
}
My problem is that I don't know what should replace the '???'. I've tried
strSQL = "SELECT COUNT(*) as count from MyTable where ID= MyLabel.Text";
but this is interpreted as "SELECT COUNT(*) as count from MyTable where ID= MyLabel.Text"
even though my debugger tells me MyLabel.Text is grabbing an OK value.
If I do strSQL = "SELECT COUNT(*) as count from MyTable where ID= 6" for example it works fine.
I think my problem is with casting?
Thanks
Majella
|
|
|
|
|
Hi,
You do like this:
strSQL = "SELECT COUNT(*) as count from MyTable where ID=" + MyLabel.Text;
Hope this will solve the problem.
Best Regards,
Apurva Kaushal
|
|
|
|
|
|
Hello:
I am building webpart that contains datagrid, this datagrid has paging but the PageIndexChanged event is not firing the first time i press the next page but after that it runs normally, only the first time it doesn't fire, any suggestions??? i tried many many things but nothing worked. The code is as follows:
protected void dgSites_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
dgSites.CurrentPageIndex = e.NewPageIndex;
dgSites.DataSource = alDataSource;
dgSites.DataBind();
}
Also i have created the datagrid in the CreateChildControls and attached the event:
dgSites.PageIndexChanged += new DataGridPageChangedEventHandler(dgSites_PageIndexChanged);
Any Help??
Regards
|
|
|
|
|
hi Hamzeh,
Be confirm that you are binding your datagrid only first time the page loads.
You have to write(if u're using c#)
if (!Page.IsPostBack)
{
// Bind the datagrid
}
Tirthadip
|
|
|
|
|
No, you have to bind the datagrid in the PageIndexChanged otherwise the paging will not work!!!! any other possibility??
|
|
|
|
|
Hi ,
I want to open the webform page in new window on clicking the imagebutton.I am using the imagebutton in HTML view in asp.net.Please help me
Thanks
|
|
|
|
|
Hi there,
use js window.open(...) to pop-up an window....
<< >>
|
|
|
|
|
can u send me any example please that describes the window.open function and its arguments.
Thanks
|
|
|
|
|
u can make that imagebutton runat="server". then on click event , u can redirect the user to new page or window.
Sandy
|
|
|
|
|
i use datagrid to show my data from the database, i add a EDIT button to allow user to change data, so , when the user click the EDIT button, normally the row of the datagrid will become textbox, how can i do to make the data become a dropdownlist for user chosing , because i dont want the user key in to edit the data, thank you!!
|
|
|
|
|
Hi cheeken,
While designing the datagrid add dropdown list in EditItem
template.So whenever you click the Edit button the row will be filled by dropdown list controls. Now in the ItemDatabound Event of your datagrid you can populate the dropdown lists with database values.You have to check the template column inside the eventhandler like that----
if (e.ItemType==ListItem.EditItem)
{
// Populate the dropdown lists
}
Tirthadip
|
|
|
|
|
hi ,
I have made a small mistake in the code.
It is
if (e.Item.ItemType==ListItemType.EditItem)
{
// Populate dropdownlist
}
Tirthadip
|
|
|
|
|
thank you for your reply, i will try it, later if i still cannot make it nice, i need your help more, so thank you.
|
|
|
|
|
i insert unicode format data from asp.net to mysql 4.1 with utf-8 encoding on the odbc 3.51 & v5 driver
but
it is insert "?????" in entity of table
Mohammad Kazem Sattari
-- modified at 3:39 Monday 8th May, 2006
|
|
|
|
|
how i can cleare the "Powerd By Crystal Report" from my Asp.net Report?
|
|
|
|
|
Hello all,
I can see how easy it is to connect to DetailsViews, FormView, etc. to be able to view+edit data. Unfortunately, I have been having problems getting it to conform to my CSS files. I almost had it working using the detailsView + ASPNETCssFriendlyAdapters, but my div declaration isn't always the same through out the form - and it wasn't placing my edit buttons in the footer.
So I want to get back to the basics. I would like to just insert the label fields, and the text boxes within my divs, and then post it to my connector.
My div code looks like...
<div class="formContent">
<div class="formText">Name:</div>
<div class="formField"><asp:TextBox ID="name" runat="server" Width="130px" tabIndex="1"></asp:TextBox></div>
</div>
<div class="formContent">
<div class="formText">Email:</div>
<div class="formField"><asp:TextBox ID="email" runat="server" Width="130px" tabIndex="2"></asp:TextBox></div>
</div>
<div class="longContent">
<div class="formText">Comments:</div>
<div class="formField"><asp:TextBox ID="comments" runat="server" Width="130px" tabIndex="3"></asp:TextBox></div>
</div>
<div class="submitButtons"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="images/submitButton.gif" /></div>
What should I wrap this in to give me a simple post feature, but allow for add+edit+delete later on?
thanks.
|
|
|
|
|
Hi,
I made a Web User Control "QuestionUserControl" that contains a RadioButtonList and a TextBox. On my web form I use that control inside a Repeater.
<br />
<asp:REPEATER id="QuestionRepeater" runat="server"><br />
<ITEMTEMPLATE><br />
<UC1:QUESTIONUSERCONTROL id="quc" runat="server"></UC1:QUESTIONUSERCONTROL><br />
</ITEMTEMPLATE><br />
</asp:REPEATER><br />
The repeater is then bound to a data source that contains records in the following format: QuestionId INT, QuestionType BYTE (1 = choice, 2 = text)
On the Repeater's DataBound event I call a public method of the QuestionUserControl passing the DataRow that contains QuestionId and QuestionType.
<br />
private void QuestionRepeater_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)<br />
{<br />
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)<br />
( (Cuestionario.QuestionUserControl)e.Item.FindControl("quc") ).ContructQuestion((DataRowView)e.Item.DataItem, this.m_Language);<br />
}<br />
The Public Method in the QuestionUserControl then shows or hides the RadioButtonList or the TextBox depending on the QuestionType. If QuestionType was "choices" the QuestionUserControl then uses QuestionId to retreive a list of choices from the database and binds that to the RadioButtonList.
After the user posts back I gather the values from the multiple QuestionUserControls created by the repeater in the QuestionUserControl_UnLoad event.
Now the problem.
I can gather all the values posted except for the very first RadioButtonList that gets created. Example:
Repeater's Datasource:
The repeater creates 5 QuestionUserControls.
QuestionId QuestionType
1 1
2 1
3 2
4 1
5 2
This creates 5 QuestionUserControls.
The QuestionUserControls that receive a QuestionType == 1, retreive a list of choices and binds them to the RadioButtonList and hide the TextBox.
The QuestionUserControls that receive a QuestionType == 2, simply hide the RadioButtonList and shows the TextBox.
When the user submits the form, the QuestionUserControl_UnLoad event gets fired 5 times, one for each QuestionUserControl created by the repeater. Inside each QuestionUserControl_UnLoad event I have access to the RadioButtonList and the TextBox contained on that particular QuestionUserControl created by the repeater, so I can gather the values of each QuestionUserControl separately.
Once again, inside each QuestionUserControl_UnLoad I can get the values w/o a problem except for the very first QuestionUserControl that has a RadioButtonList.
I changed the order of the questions to put a QuestionUserControl that gets QuestionType == 2 (text) at the top and it had no problems. So it really doesn't matter the order of the QuestionUserControls that the Repeater creates.
The very first QuestionUserControl that contains a RadioButtonList acts as if the RadioButtonList has just been initialized with properties like:
<br />
SelectedIndex = -1<br />
SelectedValue = ""<br />
Sorry for such a long post. I just wanted to make sure you have all the info to help me. This is really driving me crazy .
TIA
|
|
|
|
|
Crystal Reports in .NET
How can i create a report with crystal reports in Visual Studio.NET 2003?
i want to retrieve data from my database and show it as a report in my web application.. can anyone help me please?
Regards,
Nina
|
|
|
|
|
Crystal reports allows you to connect to the database directly from crystal reports.
So just create the report. Create the LogonInfo object and run your report.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I always get Logon Failed Error.. any idea how to fix it?
|
|
|
|