|
|
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...
|
|
|
|
|
Hi all,
i am setting the selected value of a calander like this...
calendarDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth)
how do you make the calander display this selected date now??? i know the date is correct but i dont know how to display it on the calander?
I can write the value to the database and it works fine with the correct value i just dont know how to display it... please help
Thank you in advance.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
How do you want to display it ? What calendar control are you using ? Why doesn't the SelectedDate property solve your problem ? Is Convert.ToDateTime working ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i think the convert is working...
the thing is... calDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth.ToString());
the date is set correctly on the calender... i can click on the previouse month arrow up to the correct month and see the selected date (as the correct date). When the page is loaded it is displaying the today date not the selected date? how do you specify to show the selected date on the calender itself like it is showing the current date???
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
ha ha, never mind... i figured it out...
right after this section of code:
calDateOfBirth.SelectedDate = Convert.ToDateTime(_member.DateOfBirth.ToString());code> i have added this:<br />
<br />
<code>calDateOfBirth.VisibleDate = calDateOfBirth.SelectedDate;
it is working fine now Thank you for your time any way.
"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison
|
|
|
|
|
try setting VisibleDate as well asa SelectedDate (you would assume that VisibleDate is set to SelectedDate but it isnt by default!)
|
|
|
|
|
Hi Before creating my own CSS sheet i created some forms for my project...,
In that i given some controls my own style...,
Now i like to show all my forms on same styles...,
So i created one proper CSS...,
now i like to implement that one for my forms...,
I dont like to go each forms and change what i have given previous those designs...,
How to remove those designs and how to implement newly created CSS?,
Its any other way is there?,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
You include the css in your form, and if you used named classes, you set the class names of the controls.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hai,
Can anybody give me the code snippet for the tree view to be get populated with xml nodes.
Eg. Say i am having an xml file that contains information about one book. And i want to add the chapter's headings and the sections headings in the tree view .
VanithaVasu
|
|
|
|
|
|
This is the error while i tried to bind the xml file with treeview
HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
My code is
DataSet ds = new DataSet();<br />
ds.ReadXml(Server.MapPath("xmlfile.xml"));<br />
<br />
TreeView1.DataSource = ds;<br />
TreeView1.DataBind();
My xml file contents are
<?xmlversion = "1.0" encoding="utf-8" ?>
<countries>
<country>
<text>Norway</text>
<value>N</value>
</country>
</countries>
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
modified on Thursday, January 03, 2008 4:15:38 AM
|
|
|
|
|
Sonia Gupta wrote: HierarchicalDataBoundControl only accepts data sources that implement IHierarchicalDataSource or IHierarchicalEnumerable.
Error message explains itself the problem. Check this[^] for more information. Or you can use XMLDataSource too.
|
|
|
|
|
DataSet aDataSet = new DataSet();
aDataSet.ReadXml(new StringReader(aXmlDoc.OuterXml));
the refered[^] article contains the above code.
i am unable to understand , how can i invoke the OuterXml ,
it is not appearing in the control properties(xml data source)
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
|
u have any link that delete,edit , update , insert the data using xml data source ?
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|