|
try this..
string.Format("{0 }","12/12/2007 12:00")
In stead of smiley use colon than after small d
|
|
|
|
|
CODE UNDER ROW COMMAND IN GRIDVIEW
Button b = (Button)e.Row.FindControl("update");
if (b != null)
{
string str = ChangeDateFormat(DataBinder.Eval(e.Row.DataItem, "indate").ToString());
b.Attributes.Add("onclick", "return abc(" + str.ToString() + ");");
}
CODE IN THE JAVA SCRIPT FUNCTION
function abc(s)
{
alert(s);
return false;
}
Function Defenition
public string ChangeDateFormat(string t)
{
string dat = "";
DateTime datformat;
if (DateTime.TryParse(t, out datformat))
{
dat = datformat.ToString("dd/MM/yyyy");
return dat;
}
return dat;
}
now when i click at the upDATE BUTTON TO CHECK THE VALUE IT GIVES
.6576576575757657657
I HAVED DEBUGGED THE CODE .IT IS SENDIG THE ACCURATE DATE.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Why are you doing the first part under the rowcommand click? This means that you only get the message on your second click of the button? Is that right?
|
|
|
|
|
misspelled , i was actually row bound data.
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hi all,
I have a gridview in which i used button field to delete record from database on "onrowcommand" event of gridview. It works properly. But I want confirmation of delete before deleting record from database on client click. so i think for that i need to call javascript confirm box on click and if it returns true then only onrowcommand event of control to be executed. Is it possible that way.if yes then suggest the code otherwise suggest another way.
DataKeyNames="ID" DataSourceID="SqlDataSource1" PageSize="15" AllowSorting="True" OnRowCommand = "GridView1_RowCommand" CellPadding="4" ForeColor="#333333" GridLines="None" style="width: 100%">
Text="Delete" ImageUrl="~/images/deleteicon.jpg">
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "delete_property_details")
{
int index = Convert.ToInt16(e.CommandArgument);
other code placed here
}
}
|
|
|
|
|
Hi all,
I have a gridview in which i used button field to delete record from database on "onrowcommand" event of gridview. It works properly. But I want confirmation of delete before deleting record from database on client click. so i think for that i need to call javascript confirm box on click and if it returns true then only onrowcommand event of control to be executed. Is it possible that way.if yes then suggest the code otherwise suggest another way.
DataKeyNames="ID" DataSourceID="SqlDataSource1" PageSize="15" AllowSorting="True" OnRowCommand = "GridView1_RowCommand" CellPadding="4" ForeColor="#333333" GridLines="None" style="width: 100%">
Text="Delete" ImageUrl="~/images/deleteicon.jpg">
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "delete_property_details")
{
int index = Convert.ToInt16(e.CommandArgument);
other code placed here
}
}
|
|
|
|
|
put javascript on OnClientClick event of delete button.
javascript:
<script language="javascript" type="text/javascript"><br />
function DeleteRecord()<br />
{<br />
if(confirm("Do you want to delete this record?")==true)<br />
{return false;}<br />
else<br />
{return false;}<br />
}<br />
</script><br />
I hope this will help you.
Regards.
"If I were not myself, I would like to be somebody like myself."
|
|
|
|
|
ImageUrl="~/images/deleteicon.jpg">
How to show multiple image in imageurl using ButtonField
Hi,Im Razana
|
|
|
|
|
Hi,
this is very common, but I don't know how.
How to write this in C#:
For i = 0 To aDirs.GetUpperBound(0)
as I don't see the step, which is not i++...
|
|
|
|
|
for ( i =0; i==aDirs.GetUpperBound[0]; i++ )
{
}
|
|
|
|
|
well, there is still something wrong.
Here is my code that I'm trying to rewrite in C#.
I used while and as I debugged, it is not working properly.
For i = 0 To aFiles.GetUpperBound(0)<br />
<br />
' Get the position of the trailing separator.<br />
posSep = aFiles(i).LastIndexOf("\")<br />
<br />
' Get the full path of the source file.<br />
sFile = aFiles(i).Substring((posSep + 1), aFiles(i).Length - (posSep + 1))<br />
Try<br />
<br />
<br />
' Copy the file.<br />
System.IO.File.Copy(aFiles(i), destDir + sFile, False)<br />
addToConsoleWindow("Copied " & sFile & " to " & destDir)<br />
Catch ex As Exception<br />
If overWrite = False Then<br />
errorBoxShow(ex.Message)<br />
addToConsoleWindow("Skipping..." & ex.Message)<br />
Else<br />
System.IO.File.Copy(aFiles(i), destDir + sFile, True)<br />
addToConsoleWindow("Overwriting old " & sFile & " in " & destDir)<br />
End If<br />
<br />
End Try<br />
Next i
Thank you for helping me.
|
|
|
|
|
|
(via Instant C#)
for (i = 0; i <= aDirs.GetUpperBound(0); i++)
{
}
Ack - how do you specify "less than or equal to" in this forum?? (I unchecked "Ignore HTML tags ...").
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
C++ to Ruby Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: converts C# to C++/CLI and VB to C++/CLI
|
|
|
|
|
I just want to know the IP Address of the local host using Asp.Net2.0
Response.Write(Request.UserHostAddress.ToString()); ...Here i dint get the correct IP Address...Any Sugessions
Thanks in Advance...
Erasers are for people who are willing to correct their mistakes.
|
|
|
|
|
|
Hey guys,
I totally lost it... I wrote a simple html editor on a website where users can are able to edit text to bold, italic or make a link of the selected text... The tags are written
[b]bold[/b]
[i]italic[/i]
[link url=http://www.google.com]clickable text[/link]
The bold and italic tags are simple but I can't figure out how to replace the link to a html tag <a href="url" etc.
Can anyone help me?
|
|
|
|
|
Eduard Keilholz wrote: [link url=http://www.google.com]clickable text[/link]
You need to use a regular expression to find link from the pattern. See the following code
string LinkString = "[link url=http://www.google.com]clickable text[/link]";
string RegExPattern = "\\A\\[link\\surl=(.*)].*\\[/link]$";
string FinalLink = string.Empty;
if (Regex.IsMatch(LinkString,RegExPattern))
{
FinalLink = Regex.Match(LinkString, \\A\\[link\\surl=(.*)].*\\[/link]$").Groups[1].Value;
} You have the link on FinalLink variable. Append HTML anchor tags to this to form a normal link.
Hope this helps
|
|
|
|
|
Yeah, you're pretty close however it does not work correctly with surrounding text and if the link occurs more than once within the text
for example this text should link to [link url=http://www.zonderpunt.nl]zonderpunt.nl[/link] and clicking [link url=http://www.google.com]here[/link] should link you to google...
I want to replace the text above and change the two links to working HTML links....
|
|
|
|
|
Eduard Keilholz wrote: it does not work correctly with surrounding text and if the link occurs more than once within the text
For working with multiple link, you need alter the regular expression. Now it checks the word boundaries. You can just remove that and it will find anywhere in the text. What do you mean by surrounding text ?
|
|
|
|
|
Hi,
I have datalist in which there are five image controls , but what i want is that ,in each image control i have to display 3 different images one by one, just like as adrotator control does.
how can i achieve that ,
thanks and regards
|
|
|
|
|
You should load all images firstly. then, you can use the Javascript to change the image on the fly..
|
|
|
|
|
Hi Friends,
i having two html radio buttons,one dropdownlist control and textbox control when i select first radio button it should display the empty textbox and dropdownlist control should be hide and datagrid also should hide,when i m clicking second radio button the textbox should be hide and dropdownlist control should appear.when i m selecting dropdownlist values the result should come in datagrid,up till this working when i m clicking edit,save,cancel or delete button in datagrid the selected radio button getting unchecked.Kindly tell me how to check the radio button.Please help me....
Thanks & Regards
Senthil Kumar
|
|
|
|
|
Which radiobutton are you using? I mean, server controls or just HTML control? I think if you are using the server control, you should not have that problem.. However, in order to solve this, I suggest you to store the radiobutton value in cache or session and set it back in pageload...
|
|
|
|
|
|
then, I suggest you to store the radiobutton value in cache or session and set it back in pageload...
|
|
|
|