|
thanks a banch, I will go through the links.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
HI ,
the following code if am using..
i want autoclose to "dwindow" division tag after displaying for specific seconds..
<script>
var dragapproved = false
var minrestore = 0
var initialwidth, initialheight
var ie5 = document.all && document.getElementById
var ns6 = document.getElementById && !document.all
function iecompattest() {
return (!window.opera && document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body
}
function loadwindow(width, height) {
if (!ie5 && !ns6)
window.open("width=width,height=height,scrollbars=1")
else {
document.getElementById("dwindow").style.display = ''
document.getElementById("dwindow").style.width = initialwidth = width + "px"
document.getElementById("dwindow").style.height = initialheight = height + "px"
document.getElementById("dwindow").style.left = "30px"
document.getElementById("dwindow").style.top = ns6 ? window.pageYOffset * 1 + 30 + "px" : iecompattest().scrollTop * 1 + 30 + "px"
document.getElementById("cframe").src = url
}
}
function closeit() {
document.getElementById("dwindow").style.display = "none"
}
</script>
<script>
var howLong = 10000;
t = null;
function closeMe() {
t = setTimeout("dwindow.close()", howLong);
}
</script>
<script>
function closeHelpDiv() {
document.getElementById("dwindow").style.display = "none";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="dwindow" style="position: absolute; cursor: hand; left: 0px; top: 0px; display: none"
onselectstart="return false" >
<div align="right" style="background-color: #FFFF99;">
<a onclick="closeit()" style="color: Red; font-weight: bold; cursor: pointer;">Close</a>
</div>
<div id="dwindowcontent">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
width="600" height="400">
<param name="movie" value="image/text rotation.swf" />
<param name="quality" value="high" />
<embed src="image/text rotation.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="600px" height="500px"></embed>
</object>
<script>
if (ns6) {
window.onload = new Function('loadwindow(600,400)')
}
else
loadwindow(600, 400)
</script>
</div>
</div>
</form>
</body>
txs in adavance..
Supriya
|
|
|
|
|
Whats the problem? Just call closeMe() at the end of your loadwindow method.
If you need anything else or an issue, do tell
|
|
|
|
|
This code looks like a copy paste code and do you expect people to get it working for you?.
Did you notice where the problem is ?
Check in the following line ....
document.getElementById("cframe").src = url
The function have neither "url" nor "cframe" control. How this should work ??
Before posting such query why dont you put little effort to get priliminary work done?
Thanks,
Arindam D Tewary
|
|
|
|
|
actually i'm able to bind adrotator and all data source controls using asp.net configure datasource wizard but the problem is that whenever i perform any updation in the database using these controls updation is performed in the database but the information displayed in the control is not refreshed.....i know how to do it with coding but is it possible to refresh the data in the controls through the wizard only....???
modified on Wednesday, March 31, 2010 9:52 AM
|
|
|
|
|
i want to store only date in the datetime type field but if i only provide the date....it takes some time by default..i want to remove that time information....can anyone help me with that...???
|
|
|
|
|
You cannot store only date in datetime datatype.. But you can retrieve date from datetime.. search google for this..
|
|
|
|
|
Though you store the datetime in database, while taking data out of database(using select query) you have lots of ways so that you can discard the 'time' part of it.
EXAMPLE
---------------
SELECT CONVERT(VARCHAR,GETDATE(),101)
For more options please check the CONVERT function in sql server.
It should be fine that database allows user to store date and time both.
Hope it helps,
Thanks,
Arindam D Tewary
|
|
|
|
|
As others have pointed out, you have no way to store only the date part in date time field. You have to store only datetime or store the date in a string field. Doing the later would hinder you if you wish to do data manipulation based on the date value.
Now if you try to store only the date in a datetime column, the db by default would add 00 hrs as the default time value [correct me if I'm wrong].
Now you can easily remove the time part in the query using CONVERT(VARCHAR,[date column],101) . But doing so would put extra load on your query and reduce its performance.
The best way to deal with it is to get the datetime value to the application and apply formatters to remove the time part from the datetime value. All that you need to do is to set the format string for the control that is going to display the value and you would be done.
HTH!
|
|
|
|
|
hi....thanks for your reply
i've used all those functions to retrieve date from the field...but i just thought that if we would be able to save date only then how cool it would be.....anyways thanks for your reply
|
|
|
|
|
Hi..
I creatd some dynamic textboxes in repeater control.. Had a button to add textboxes.. and link button to delete the rows from db..
im deleting the rows from repeater based on id in the table...upto this its working fine. But when i click on add button to add more rows and if i want to delete those rows, as they dont have any id in table how do i delete those rows..
|
|
|
|
|
where you are keeping the newly added object?or in other words do u have any persisting DataSource object for repeater?
|
|
|
|
|
the values in the added text boxes if required they are inserted into db.. But before inserting if i need to delete them how can i...
|
|
|
|
|
test-09 wrote: the values in the added text boxes if required they are inserted into db.. But before inserting if i need to delete them how can i...
when clicking new row button how you are adding rows to repeater?Do u have any persisting object in code behind?Have tried deleting by index of the repeater item?
|
|
|
|
|
this is how im adding new row...
private void adddescription()
{
int rowIndex = 0;
if (ViewState["CurrentTable"] != null)
{
dtDesc = (DataTable)ViewState["CurrentTable"];
DataRow drCurrentRow = dtDesc.NewRow();
if (dtDesc.Rows.Count > 0)
{
for (int i = 1; i <= dtDesc.Rows.Count; i++)
{
TextBox box1 = (TextBox)Rptdescription.Items[rowIndex].FindControl("TextName");
TextBox box2 = (TextBox)Rptdescription.Items[rowIndex].FindControl("TextDate");
TextBox box3 = (TextBox)Rptdescription.Items[rowIndex].FindControl("TextDescript");
drCurrentRow = dtDesc.NewRow();
drCurrentRow["RowNumber"] = i ;
ViewState["RowNumber"] = drCurrentRow["RowNumber"];
Label1.Text = ViewState["RowNumber"].ToString();
dtDesc.Rows[i - 1]["DescriptionName"] = box1.Text;
dtDesc.Rows[i - 1]["Date"] = box2.Text;
dtDesc.Rows[i - 1]["Description"] = box3.Text;
rowIndex++;
}
dtDesc.Rows.Add(drCurrentRow);
}
else
{
dtDesc = (DataTable)ViewState["CurrentTable"];
DataRow descRow = dtDesc.NewRow();
descRow["DescriptionName"] = "";
descRow["Date"] = "";
descRow["Description"] = "";
dtDesc.Rows.Add(descRow);
}
}
Bindrepeater();
}
|
|
|
|
|
Okay.Delete button is in the repater.right?then in the delete button click event you'll get the item index and using that item index delete that object from the viewstate and rebind repeater.is that makes sense?
|
|
|
|
|
im losing the values in textboxs on postback.... i cant check which row im deleting correctly as the values go on postback...
int iddelete;
iddelete = ToInt(e.CommandArgument.ToString());
if (iddelete!=0)
{
}
else
{
int count = e.Item.ItemIndex;
dtdelete.Rows[count].Delete();
dtdelete.AcceptChanges();
Rptdescription.DataSource = dtdelete;
Rptdescription.DataBind();
}
|
|
|
|
|
test-09 wrote: im losing the values in textboxs on postback...
Which values you are loosing?ItemIndex is enough to delete it from ViewState?Is this code working?whats the difficulty you are facing in the above code?
If you are saying about entered values in textboxes, then save that values to the persisting object before rebinding the repeater.
|
|
|
|
|
the last row is deleting if i click on delete of any row... what may be problem
|
|
|
|
|
You might have 'hard coded' index of last row. Please check that. This could be the case.
Thanks,
Arindam D Tewary
|
|
|
|
|
i'm new to asp.net...i don know all its technicalities.....i want to create a seat chart of some auditorium using javascript and enable and disable some of its seats....also allow user to select some of the seats without page reload(only the color of those seats may get changed....and i may be able to collect their seat numbers)
if anyone can help me with this or can tell me some other way to create such a user interactive seat chart...???
|
|
|
|
|
Its better to use update panel other than Java script for seat chart
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi....if you can please elaborate how can i use the update panel for the seat chart of a cinema hall as i'm not through with all the technicalities of asp.net....as i'm still studying it.
modified on Wednesday, March 31, 2010 12:27 PM
|
|
|
|
|
First how You are trying to display the number of seats. are you trying to use the buttons or any control.
I suggest you the update panel because it will not refresh the whole page .
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hi all....
i'm using html input button for this purpose....but i'm unable to retrieve the values in .cs file....what i want is to display arrangement of around 100 seats in a theatre...and would like user to select some seats whose color will change on clicking without reloading the page.....and in .cs file i may be able to retrieve the seat numbers...???
same seat chart as you would find one while booking tickets for a movie online....they ask you select seats of your choice....i wanna do the same thing....can anyone help me???
|
|
|
|