|
Thks for your suggessiotions...i did this through using Sessions....
|
|
|
|
|
you can do this using session
ex.
Session["var"]=tbl.rows[0]["id"].tostring();
I will do my best?
|
|
|
|
|
Hi
I have a webpage with gridview contains a data. the delete button which is outside of gridview. When the user selects the row and clicks on delete button, then the row is deleted. But i want to ask for confirmation to user before deleting the record using javascript.
How can i do this. How can i check whether row has been selected or not using javascript.
Note: The "Delete" button is outside of gridview.
I welcome all type of suggestions
G. Satish
|
|
|
|
|
Hi Sathish,
call this code snippet in page_load, For confirmation
btnDelete.Attributes.Add("onClick","javascript:return confirm('Are you sure to delete the records?')");
|
|
|
|
|
But i need to check whether the record is selected or not in gridview before asking this confirmation. Once the record has been selected, then only i need to ask for confirmation. My problem is how to find whether the record is selected or not in Grid view. I have no checkboxes in gridview. i used selected index in gridview in codebehind.
G. Satish
|
|
|
|
|
call this code snippet in page_load, For confirmation
btnDelete.Attributes.Add("onClick","javascript:return confirm('Are you sure to delete the records?')");
put select button in gridview and work with selected index change event in a page.so whenever u select any row the then selectedindex change event will be fired and then u just put the row no in a viewstate variable.as a result when u click on btnDelete button then btnDelete_click event will be called and from that function u just check that viewstate variable value and if no value or null is there that mean no row is selected or if row no is found in that viewstate variable then remove that record from db by sql and rebind the gridview.i hope this way u can solve ur problem.
tbhattacharjee
|
|
|
|
|
Is there anyway you can use a html tag like <pre>,<b> etc in a list box. I know you can use   in the list box with the following method:
ListItem testList = new ListItem(Server.HtmlDecode(" ") + "test");
ListBox1.Items.Add(testList);
This however doesn;t work for HTML tags.
Any help is as always appreciated.
"When will I learn? The answers to life's problems aren't at the bottom of a bottle. They're on TV" - Homer Simpson
|
|
|
|
|
how to find checked checkboxes in datalist
|
|
|
|
|
try below..
for i=0 ; i<=datalist.rows.count;i++
dim chk as new checkbox
chk=(checkbox)datalist.rows(0).findcontrol("checkbox").value=true
if chk.checked=true
..
else
..
end if
Pinna
|
|
|
|
|
Do not spoon feed him.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You know what I did...
Copied your question i.e.
egainzz wrote: how to find checked checkboxes in datalist
added ASP.Net to it(the forum name)...
And pasted this in Google...though i didnt see any of pages but i expect that it would have answers your question.
try this[^]
Well, I did all this so that you understand tht its quick and easy to google yourself than asking all studpid question at CP forum
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello,
I want to bind the dataset to crystal reports. for this i am writing the code like below..
Conn = New SqlConnection(StrConn)
Dim cr1 As New ReportDocument
Dim sql As String, ds As New DataSet
sql=" " ' WRITING query to retreive values from morethan one table
Dim da As New SqlDataAdapter(sql, Conn)
da.Fill(ds, "tablename")
Dim strReport As String = Server.MapPath("reportname.rpt")
cr1.Load(strReport)
cr1.SetDataSource(ds)
crptSales.ReportSource = cr1
But it is not working.if you find anything wrong please tell me..
Thanks
Pinna
|
|
|
|
|
hi all ,
i have used date selector control in my aspx page and when iam clicking on image to popup the control it is not displaying and in last of page iam getting message that error page .
i want that when user click on image a popup will apear from where user can select the date .
here is my java script code for calling date selector .
&
lt;img id="Img2" onclick="javascript:return popUpCalendar(Img2,<%=txtStartDate.ClientID %>, 'mm-dd-yyyy', '__doPostBack(\'<%=txtStartDate.ClientID %>\')')" alt="" src="UseDateSelector_files/calendar.GIF" border="0" /></td>
suggest me where iam doing mistake .
regards
Rameez
|
|
|
|
|
I think that the same question was posted 1 or 2 days back
Cheers!!
Brij
|
|
|
|
|
thanks brij for reply,
yes it was posted before but iam not able to figure out the error thatswhy posted again .
please suggest me where iam doing mistake
regards
Rameez
|
|
|
|
|
hi folks,
I wud like to display running time in my page using javascript.For that i ve used the following client side function.
<form name="counter"><input type="text" size="8"
name="d2"></form>
<script type="text/javascript">
var milisec=0
var seconds=120
// document.counter.d2.value=0
function display()
{
if (milisec<=0){
milisec=9
seconds-=1
}
if (seconds<=-1)
{
milisec=0
seconds+=1
}
else
milisec-=1
document.counter.d2.value=seconds+"."+milisec
setTimeout("display()",1000)
}
display()
ive hardcoded it as 120 seconds.But i need to pass a value from code behind dynamically and make the timer run for that value.
for e.g i want to pass as display(180) and run the timer.Is there any way of achieving this?Thanx in advance
T.Balaji
|
|
|
|
|
Use RegisterClientVariable
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
can u send me the code?
T.Balaji
|
|
|
|
|
At Server Side:
ClientScript.RegisterHiddenField("someHiddenField", "120");
At Client Side:
var someValue = document.getElementById("someHiddenField");
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
We are new to Nhiberanate concept, We had downloaded the NHibernate sample form CodeProject site using http://www.codeproject.com/KB/architecture/NHibernateBestPractices.aspx. We had executed this sample it is working fine, but when we are tring add our form in an application it doesn't not display any record. Following is our code.
Table signature
CREATE TABLE [dbo].[TBL_EMPLOYEE](
[EMP_CODE] [int] IDENTITY(1,1) NOT NULL,
[EMP_NAME] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EMP_DEPTNAME] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[EMP_EMAILID] [varchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[EMP_PASSWORD] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
CONSTRAINT [PK_TBL_EMPLOYEE_1] PRIMARY KEY CLUSTERED
(
[EMP_CODE] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
hbm.xml file
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="BasicSample.Core.Domain.Employee,BasicSample.Core" table="TBL_EMPLOYEE" lazy="false">
<id name="EMP_CODE" column="EMP_CODE" unsaved-value="0">
<generator class="identity"/>
</id>
<property name="EMP_NAME" column="EMP_NAME" type="String"/>
<property name="EMP_DEPTNAME" column="EMP_DEPTNAME" type="String"/>
<property name="EMP_EMAILID" column="EMP_EMAILID" type="String"/>
<property name="EMP_PASSWORD" column="EMP_PASSWORD" type="String"/>
</class>
</hibernate-mapping>
.class file
using System;
using System.Collections.Generic;
using BasicSample.Core.Utils;
namespace BasicSample.Core.Domain
{
public class Employee:DomainObject<string>
{
private Employee()
{ }
public Employee(string EmpName)
{
EMP_NAME = EmpName;
}
//private variable
// private int _Code="";
private string _Name = "";
private string _DeptName = "";
private string _EmailId = "";
private string _Password = "";
//public string EMP_CODE
//{
// get { return _Code; }
// set { _Code = value; }
//}
public string EMP_NAME
{
get { return _Name; }
set { _Name = value; }
}
public string EMP_DEPTNAME
{
get { return _DeptName; }
set { _DeptName = value; }
}
public string EMP_EMAILID
{
get { return _EmailId; }
set { _EmailId = value; }
}
public string EMP_PASSWORD
{
get { return _Password; }
set { _Password = value; }
}
public override int GetHashCode()
{
return (GetType().FullName + "|" + EMP_NAME + "|" + EMP_DEPTNAME).GetHashCode();
//throw new Exception("The method or operation is not implemented.");
}
}
}
aboce are the files we were using but after broswing the apge it show nothing. Where is the problem we are not able to identify?
poonam
|
|
|
|
|
The article which you shown has a discussion board attached. Chances are more to get help if you use that.
|
|
|
|
|
Hi all
Im using VS 2003 for small web application i have a problem when im using fileuploader,i have some mandatory fields and im using labels for check the requried fields,when i click the submit button my file Uploader path is clear when mandatory field is left, i want to avoid the clear the path of file uploader when that kind situation pls help me to do this,
Thanks,
|
|
|
|
|
This is not possible. You can't write to FileUpload control.
|
|
|
|
|
There is some problem in validation because if any field which is mandatory left blank then it should not make server trip and when you click on submit it will take server trip so at that time path clear is very obvious.
So make sure about validations.
Reasons are not Important but Results are Important.
Swati Tripathi
|
|
|
|
|