|
hi
I am entering some text in div at run time. I want if a website url is entered then it should be clickable and redirect to that site just like in chatting window.
Please Help.
Thanks in advance.
|
|
|
|
|
Hi
Check the text is a valid url with regular expression, if valid then render the text with "<a href='textvalue'>textvalue</a>' tag.
Cheers
Prosanta
|
|
|
|
|
I am entering text in div on button click at runtime just like chat window when user click on send button the text is entered into div. In that case how to do this?
|
|
|
|
|
you will have to do the same thing that Prosanta already said...search for text that could be links and make them into links. Here is a sample that shows how to do this: http://benalman.com/code/test/js-linkify/[^]
|
|
|
|
|
Hi, you can refer to the following code:
private void Button1_Click(object sender, System.EventArgs e)
{
string strContent = InputTextBox.Text;// <---the input text
Regex urlregex = new Regex(@"(http:\/\/([\w.]+\/?)\S*)", // <--check if url
RegexOptions.IgnoreCase| RegexOptions.Compiled);
strContent = urlregex.Replace(strContent,
"<a href=\"\" target=\"_blank\"></a>"); // <-- set display like a link
Regex emailregex = new Regex(@"([a-zA-Z_0-9.-]+\@[a-zA-Z_0-9.-]+\.\w+)",
RegexOptions.IgnoreCase| RegexOptions.Compiled);
strContent = emailregex.Replace(strContent, "<a href=mailto:></a>");
lbContent.Text += "<br>"+strContent;
}
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:46am.
|
|
|
|
|
I am having the Aspx page in which button is there in update panel.when i click the button i have to display a message in messagebox.For that i am using class which is in seperate project.
public class Class1
{
//[DllImport("User32.dll")]
//public static extern int MessageBox(int h, String s, String s1, int type);
public void showmessage(Page sender,EventArgs e)
{
ScriptManager.RegisterClientScriptBlock(sender, sender.GetType(), "Key", "alert('Message Displayed');", true);
}
}
I am calling this class in my Web page.On button click i am calling this class methd which is showing the message box.Code for button click
protected void btnClick_Click1(object sender, EventArgs e)
{
TestClass.Class1 test = new TestClass.Class1();
test.showmessage(this.Page, e);
}
but it is not working.If i register the script on same web page then it is working fine or if i put button outside the updatepanel then it is working properly.
Is that any solution to register javascript on webpage through class? please reply..........
|
|
|
|
|
Hi
Try to use following code...
ScriptManager.RegisterClientScriptBlock(sender, sender.GetType(), "Key", "Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(function(){alert('Message Displayed');})", true);
Thanks
Prosanta
|
|
|
|
|
This code i have added in class but still the messagebox is not showing.
But if i put in the page then it is showing.I want the code in class only.
Any other solution.Please Reply.modified on Friday, February 26, 2010 1:48 AM
|
|
|
|
|
i read a article,
Person data access
public void Person_Save(ref int personID, string nameFirst, string nameLast, DateTime dob)
{
SqlCommand cmd;
ExecuteNonQuery(out cmd, "Person_Save",
CreateParameter("@PersonID", SqlDbType.Int, personID, ParameterDirection.InputOutput),
CreateParameter("@NameFirst", SqlDbType.NVarChar, nameFirst),
CreateParameter("@NameLast", SqlDbType.NVarChar, nameLast),
CreateParameter("@DOB", SqlDbType.DateTime, dob));
personID = (int)cmd.Parameters["@PersonID"].Value;
cmd.Dispose();
}
person Business
public void Save(IDbTransaction txn)
{
new Demo.DataAccessLayer.PersonDataService(txn).Person_Save(ref _personID, _nameFirst, _nameLast, _dob);
}
i implement in VB.net
Layer Access DATA
Public Sub contacto_cliente_auto_Insert(ByVal contacto_id As Integer, ByVal cliente_id As Integer, ByVal serie As String)
'revisado
ExecuteNonQuery(SP.Nombre.cw_co_contacto_cliente_auto.ToString(), _
CreateParameter("@i_contacto_id", AseDbType.Integer, contacto_id), _
CreateParameter("@i_cliente_id", AseDbType.Integer, cliente_id), _
CreateParameter("@i_serie", AseDbType.NVarChar, serie))
End Sub
Layer Business
Public Sub contacto_cliente_auto_Insert(ByVal contacto_id As Integer, ByVal cliente_id As Integer, ByVal serie As String)
new AccesoDatos.CRMWEB.AccesoDatos.contacto_cliente_autoCD().contacto_cliente_auto_Insert(contacto_id, cliente_id, serie)
End Sub
then new is incorrect in Layer Business.
i have the message Syntax Error
Thanks for the time
Regards
|
|
|
|
|
i think you should try the following
Dim a as new AccesoDatos.CRMWEB.AccesoDatos.contacto_cliente_autoCD
a.contacto_cliente_auto_Insert(contacto_id, cliente_id, serie) -Regards
Bharat Jain
bharat.jain.nagpur@gmail.com
|
|
|
|
|
I'm implementing 2 new sections into my current asp.net website: blogs & forums. These blogs & forums are both open source website projects that I downloaded, so as it stands right now, each one is its own separate website.
So I'm curious as to the best way to implement these 2 new sites into my current solution. My plan is to have their url setup as subdomains (i.e. http://blog.MySite.com, http://forum.MySite.com). Should I create 2 separate web projects within my solution (and if so, will I be able to pass session objects from one site to another)?
Just curious as to the best way to set this up to ensure the site still moves quickly and doesn't start allocating unnecessary resources (i.e. if I click on my forums, I shouldn't have to load blog data into memory).
Thanks.
|
|
|
|
|
Hi All,
I am using Http Handler ashx file for showing the images. I was using Session object to get image and return in the response
Now problem is i need to use custom Session object its nothing but the Wrapper on HttpSession State But when i am trying to get existing custom session object its creating new ... its not showing session data , i checked the session Id which is also different Please adive how can i get existing session in ashx file ?
Note: When i use ASP.NET Sesssion its working fine
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class GetImage : IHttpHandler, System.Web.SessionState.IRequiresSessionState
{ Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
I was reading an ASP.NET reading about AJAX ScriptManager.EnablePartialRendering -
http://www.asp.net/learn/ajax/tutorial-01-cs.aspx
I have tried the example - it basically demonstrates Partial Rendering - without page refresh and render the whole page.
with ScriptManager.EnablePartialRendering = true, you click a button and change a text of a label. The text is updated by the script without posted back from the server evidenced by observing the rendered source page.
I copy exactly the same codes but everytime I click the button the page refreshes. I am using vs2005 .NET 2.0 and AJAX extension 1.0 (same version as used in the article)
I have examined after the page is loaded-
ScriptManager1.EnablePartialRendering = true
ScriptManager1.SupportsPartialRendering = true
Can anyone shed some light what might have gone wrong?
Thanksmodified on Wednesday, February 24, 2010 3:52 PM
|
|
|
|
|
Hello,
I am generating a report from a web application written in .Net 1.1. The report is designed using html and no third party is involed for reporting. Now i wana save this page in pdf and want to send as an attachment. How to convert the report in to pdf format?????
Thanks,
Safvi
|
|
|
|
|
Use ABCPdf which is third party dll which help you to convert html page to pdf format
|
|
|
|
|
iam having the table log table
the fields are userid, logintime,logouttime,totaltimespend
when ever user login or logout he should be updated in database using triggers in sql server 2005 and using asp.net with c# and get the total hours he spend.
|
|
|
|
|
Totaltimespent is a useless column since you have logon and logout times.
I'm not sure I see your question I know the language. I've read a book. - _Madmatt
|
|
|
|
|
As Mark said, you probably don't need the "totaltimespend" field. Keeping track of login & logout time should suffice.
I may be wrong on this, but triggers aren't the way to go for keeping a log table like this. Personally, I would update the "logintime" via my c# code when the user successfully logs in.
For logouttime, there's an event in your Global.asax file called "Session_End". Within there, simply open a connection to your log table and update logouttime.
Hope that helps.
-Goalie35
|
|
|
|
|
hi,
i want to use charts in crystal reports ,based on the values it should generate graphs.. using asp.net with c#
|
|
|
|
|
there are default different knid of graphs available in .Net itself, after generating the report just click the icon related to graph it will take you to what u want
|
|
|
|
|
Hi All
is it possible to click a button on a web user control and have it retain the focus of the current control on the webform ?
I am trying to integrate the cool TCKeypad Numeric Keypad Web User Control[^] into a webform and want the output of the button to go to the current control of a textbox on my webform rather than the built in textbox of the control.
Any ideas or suggestions would be appreciated
Cheers
Dom
|
|
|
|
|
Have you tried leaving a message for the author of the control - if anyone would know he would.Tychotics: take us back to the moon
"Life, for ever dying to be born afresh, for ever young and eager, will presently stand upon this earth as upon a footstool, and stretch out its realm amidst the stars."
H. G. Wells
|
|
|
|
|
Hello, this is Vikash gohil.
I have created a Activex Control in VB6.0
I have also created the CAB File to deploy this control.
Now I do not know where to place the CAB file, ie in which folder.
Should i put it in Bin folder or the same folder in which the aspx page that uses the control exists.
Also do i need to put the CAB file and the support folder both or just the CAB file.
Please anyone can help me in this matter.
this is my first web deployment, any help would be greatly appreciated.
awaiting your response.
|
|
|
|
|
Hi guys!
I am working as a web developer. In one of my web aspplication in asp.net I am facing problem.
my aspx page will contains following html tags
<asp:FormView ID="fvwTenderProposal" runat="server" ....>
<EditItemTemplate>
<ajaxToolkit:TabContainer ID="tabContainer1" runat="server">
<ajaxToolkit:TabPanel ID="tabPanel1" runat="server" Header="Tab1">
<ContentTemplate>
<asp:TextBox id="txtBox1" runat="server"></asp:TextBox>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabPanel2" runat="server" HeaderText="Tab2">
<ContentTemplate>
<asp:TextBox id="txtBox2" runat="server"></asp:TextBox>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</EditItemTemplate>
</asp:FormView>
As I am disabling the controls inside ajax tab container->tabpanel which is then again contains into the Form view control.
So there are two controls outside ajax tab container TextBox3 & Button1. But these are contains into the formview.
So when I am enter date(or any text) into the TextBox3, then controls inside the current opened tab get disabled using client script as follows
<script type=”text/javascrpt”>
function disabledTabControls()
{
var objCtlTabPanel1 = $get('<%= fvwTenderProposal.FindControl("tabContainer1").ClientID %>' + "_tabPanel1");
var objCtlTabPanel2 = $get('<%= fvwTenderProposal.FindControl("tabContainer1").ClientID %>' + "_tabPanel2");
var objTxtBox1 = $get('<%= fvwTenderProposal.FindControl("tabContainer1").ClientID %>' + "_tabPanel1_txtBox1");
/* there are many controls within the tab panel which want to make enable false. So that user can not edit it.*/
objTxtBox1.disabled = false;
}
</script>
After that when user click on Button1, then I want to get tabpanels controls data and save it into database as follows
protected void Button1_OnClick(object sender, EventArgs e)
{
AjaxControlToolkit.TabContainer tabContainer1 = fvwTenderProposal.FindControl("tabContainer1") as AjaxControlToolkit.TabContainer;
if (tabContainer1 != null)
{
// For current tab panel
AjaxControlToolkit.TabPanel tabPanel1 = tabContainer1.FindControl("tabPanel1") as AjaxControlToolkit.TabPanel;
if (tabPanel1 != null)
{
TextBox txtBox1= tabPanel1.FindControl("txtBox1") as TextBox;
if (txtBox1!= null)
{
string strTextBox1 = txtBox1.Text;/* Here I am not getting data;
Instead if I do not call any client script like ‘disabledTabControls()’ for
disabling controls, then here I am getting data properly.
So here I am facing problem. */
}
}
}
/* code for save ‘strTextBox1, etc’ into database */
}
Hope you understand my problem and let me suggest some solution.
Regards,
Rakesh
|
|
|
|
|
|