|
Hello is there a way that the controls on my aspx page understand the html code and display accordingly...example:
If a textbox is there..I press on button named 'B'..
then contents in textbox become Bold...
I.e.the textbox should be in a state to handle html coding just like a html browser..if we enter Hello
textbox field should show Hello in bold letters...instead of all that crap like
Hello
Is there a way for it
|
|
|
|
|
No, there isn't. But you can take an element that does support html codes, like a div tag, and make it editable.
---
b { font-weight: normal; }
|
|
|
|
|
I'm new to ASP.NET so any help pointing me in the right direction would be great!
I've figured out how to send and receive email (sending using the built-in .NET classes, and receiving using the AdvancedIntellect aspNetPOP3 component, since I couldn't see any built-in classes for this). My problem is I don't know how to make the website check for the email on regular basis.
Essentially what I want to do is have the website check the email (POP) server (every 30 seconds or so?) check the subject (etc) of the email, and then send a response email with some appropriate data from my database.
Should I setup a timer? Is this "not recommended" for an asp.net application, and should be done some other way?
Thanks
Warren
|
|
|
|
|
Well, depending on the circumstances, you might just want a console application or windows service running on the server to periodically check your POP mail.
|
|
|
|
|
Mike Ellison wrote: a console application or windows service running on the server
That's what I was thinking of as an alternative, but I didn't know if those (i.e. a Windows service) are typically available in a hosted environment??? Do you know if that is typically the case?
Having previously been responsible for keeping a server going, I really want to use a hosted environment where someone else keeps the thing patched (etc).
|
|
|
|
|
It would be worth discussing it with your host; your host may very well provide some kind of scheduled task service themselves.
There are approaches to use though if your requirement has to be within the context of ASP.NET code. You could start a new thread in the Application.Start event to poll for your emails. This article shows an example of that approach:
http://www.angrycoder.com/article.aspx?cid=5&y=2003&m=4&d=11[^]. As the article author points out, there are some pitfalls to this approach, but you can decide if it will work for your setup.
|
|
|
|
|
please guild me in my newbiew question >.<
the dropdownlist i am uisng now is binded to an sql database
so whenever i wanna know whcih item was selected its like
DropDownList1.SelectedValue
however this only returns numbers and not the actual data from the dropdownlist
can anyone tell me how can i get the actual data of the dropdownlist pls.
|
|
|
|
|
When binding a dropdownlist to a datasource, the list's property DataValueField will determine what is returned in .SelectedValue . Make sure you have DataValueField set to the database column you wish to retrieve.
|
|
|
|
|
Use DropDownList1.SelectedItem.Text to get what is displayed on the page in the ddl.
|
|
|
|
|
I would think it would be out there.... but does anyone know or have the steps required when you need to rename a solution and a project within the solution in ASP.NET using Visual Studio 20005? I really have searched quite extensively and have found nothing. Here is what I think you need to do ( assume project and solution starting names are xxx, ending names yyy. Also assume not using IIS). This is a bit rough and not well-written, but I am actually hoping someone can point me to directions that are better than mine!
1) rename directory name from xxx to yyy in explorer
2) rename xxx.sln to yyy.sln in explorer
3) edit the yyy.sln file in notepad and change xxx directory to yyy directory
4) rename ....\WebSite\xxx to \yyy in explorer
|
|
|
|
|
If you use the Web Project 2005, then it will be easier to rename the project name. Basically, there is no the Rename item in the menu context for the ASP.NET web site, so if you want to replace the name, you can do in the way you mentioned. In addition, you may also try removing the project out of the current solution, rename the web site folder, and readd it to the solution. And for the solution name, you can rename in the Solution Explorer.
|
|
|
|
|
Hello,
I have to open a popup and pass values from controller in UIPAB. Any idea how to open an popup without navigating to any view from the caller screen?
I appreciate any help
- ashish
|
|
|
|
|
Hi,
i've got a datasource ie "employees" with columns id, name, surname.
I'm binding to a gridview, but display only name, surname but i'v added a select column. How do I get the ID VALUE for the selected row, when i click on select hyperlink in the select column.
thx
Regards,
Tintin
|
|
|
|
|
Get it from the DataKeys collection for the selected row like this?
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
Try
Dim iInt As Integer = CType(GridView1.DataKeys(e.RowIndex).Value, Integer)
' Do stuff here
Catch ex As Exception
LogException(ex)
End Try
End Sub
|
|
|
|
|
I am trying to write an application in ASP.NET with c sharp that would prompt the user for a drive letter, computer name and share name (i.e. f:\\192.168.0.100\myShareFolder) and after the client enters this information the application will automatically map a network drive on the client’s computer.
I found an example in C sharp (http://www.codeproject.com/csharp/mapnetdrive.asp)that would do this operation however when I implemented it in ASP.NET it only worked on the server computer.
Please help!
Thanks
chhabrni
|
|
|
|
|
chhabrni wrote: however when I implemented it in ASP.NET it only worked on the server computer.
This is because it is server side code. You can't alter the client's hard drive. I don't believe that this is possible via client side script either, due to the security issue it would pose.
|
|
|
|
|
Thanks for the response.
In that case, is there any way I can run an application (exe) on the client's computer? (i.e. open notepad on client's computer after clicking a button on the aspx web page). Maybe there is a function that the client has to authorize so that the application can run on the client’s computer?
I appreciate the help.
|
|
|
|
|
In my MasterPage I have this code:
private string _callbackResult = null;
protected void Page_Load(object sender, EventArgs e)
{
string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "Result1", "context");
string cbScript = "function UseCallback1(arg, context)" + "{" + cbReference + ";" + "}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "UseCallback1", cbScript, true);
}
public void RaiseCallbackEvent(string eventArg)
{
string res = AgentLogin(eventArg).ToString();
_callbackResult = res;
}
public string GetCallbackResult()
{
return _callbackResult;
}
When I open the first page - everything is ok! But when I move to the second page I can see that there is no "UseCallback1" JavaScript function in HTML!
Help me please to fix this problem!
|
|
|
|
|
A simple check is that the web page 2 uses the master page?
|
|
|
|
|
hi,
I have a user control with one textbox(ie a javascript calender). I want to access the value of text box by javascript
User control name: Cal1
textbox ID=txt_Date
By Binu Varghese
|
|
|
|
|
You will need to output the client id of the control (i.e. txt_date.clientID) to the page as a javascript variable. The client id depends on the nesting of the user control in other server controls on the page.
|
|
|
|
|
i didn't get you, how to output the clientID of the text box. Can u help me to solve the problem.?
|
|
|
|
|
Either put it in the mark up as an attribute on the text box, or assign it in the code behind : tbYourTextBox.ClientID.
|
|
|
|
|
aspx.vb file
Public Class Default1<br />
Inherits System.Web.UI.Page<br />
<br />
Dim inc As Integer<br />
Dim txtEventDate As Date<br />
Dim txtEventTrigger As Date<br />
<br />
Dim objConn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source= " & Server.MapPath("~/App_Data/db1.mdb"))<br />
<br />
Public Sub LoadData()<br />
Dim da As New OleDbDataAdapter("SELECT * FROM checklist_Items", objConn)<br />
Dim ds As DataSet = New DataSet()<br />
da.Fill(ds, "checklist_Items")<br />
<br />
MyDataList.DataSource = ds.Tables("checklist_Items").DefaultView<br />
MyDataList.DataBind()<br />
<br />
End Sub<br />
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br />
If Not IsPostBack Then<br />
LoadData()<br />
End If<br />
<br />
End Sub<br />
Sub Update_dc(ByVal ID)<br />
<br />
'---updates the database---<br />
Dim sql As String = "UPDATE checklist_Items SET date_Completed=#" + txtEventDate + "# WHERE ID=" + ID<br />
Dim comm As New OleDbCommand(sql, objConn)<br />
<br />
objConn.Open()<br />
comm.ExecuteNonQuery()<br />
objConn.Close()<br />
<br />
MyDataList.EditItemIndex = -1<br />
LoadData()<br />
<br />
End Sub<br />
<br />
Sub Update_dt(ByVal ID)<br />
<br />
'---updates the database---<br />
Dim sql As String = "UPDATE checklist_Items SET date_Trigger=#" + txtEventTrigger + "# WHERE ID=" + ID<br />
Dim comm As New OleDbCommand(sql, objConn)<br />
<br />
objConn.Open()<br />
comm.ExecuteNonQuery()<br />
objConn.Close()<br />
<br />
MyDataList.EditItemIndex = -1<br />
LoadData()<br />
<br />
End Sub<br />
Sub MyDataList_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles MyDataList.UpdateCommand<br />
Dim tbox As TextBox<br />
Dim ID0 As String<br />
Dim sday As DateTime<br />
<br />
'---retrieves the key for the row---<br />
ID0 = MyDataList.DataKeys(e.Item.ItemIndex)<br />
<br />
'---find the textbox control containing the dateCompleted<br />
tbox = CType(e.Item.FindControl("txtEventDate"), TextBox)<br />
txtEventDate = tbox.Text<br />
sday = txtEventDate<br />
If (ID0 = 5) Then<br />
Update_dc(ID0)<br />
MsgBox("eventdate " + txtEventDate)<br />
'---retrieves from another database---<br />
Dim con = "Provider=Microsoft.Jet.OLEDB.4.0;" & _<br />
"Data Source= " & Server.MapPath("~/App_Data/vcalendar.mdb")<br />
Dim da As OleDbDataAdapter<br />
Dim dc As New DataSet<br />
<br />
'Dim con As New OleDb.OleDbConnection<br />
Dim cn As OleDbConnection = New OleDbConnection(con)<br />
cn.Open()<br />
Dim c As String = "SELECT * FROM events"<br />
<br />
da = New OleDb.OleDbDataAdapter(c, cn)<br />
da.Fill(dc, "events")<br />
cn.Close()<br />
<br />
'---find the textbox control containing the dateTrigger<br />
Dim tbox1 = CType(e.Item.FindControl("txtEventTrigger"), TextBox)<br />
txtEventTrigger = tbox1.text<br />
tbox1.Text = dc.Tables("events").Rows(inc).Item(26)<br />
<br />
Dim objdate As DateTime = New DateTime(Year(tbox1.Text), Month(tbox1.Text), Day(tbox1.Text))<br />
Dim sday1 As DateTime = objdate<br />
sday1 = sday1.AddDays(5)<br />
txtEventTrigger = sday1<br />
<br />
Update_dt(ID0)<br />
<br />
<br />
End If<br />
<br />
End Sub
i'm trying to update into database A this row and cell(date_Completed) with the value i typed into the textbox but at the same time, when i clicked on update, it should update the above statement as well as retrieve from another database B's table value and add 5 days. Upon addition, it should update the calculated value into the database A's same row and cell(date_Trigger).
But i'm facing this problem now that when i click on update, it will update the retrieved date from database B into database A's cell(date_Completed) and update the calculated value into database A's cell(date_Trigger). It kind of overwrites the value i typed in the textbox that was supposed to be updated and stay in the database A's cell(date_Completed).
I hope someone out there is able to understand my codes and provide me further help into this. Btw, if you think you needed more details into the .aspx file, please let me know. Thanks.
frossie
|
|
|
|
|
Response.Redirect("ProductListing.aspx?BrandID="+DropDownList1.SelectedValue+"&CatID="+DropDownList2.SelectedValue);
can anyone explain wat this code is for?
i am currently trying to understand an sample project
this code is found inside an button which suppos to query the 2 listbox
however everytime i click it the queary on the dropdownlist2 is set back to all instead of the one i choice.
some other question:
pls correct me if i am wrong
pageload is an function activated when a button is pressed rite?
is there any function that is for when the page is load at first(meaning run once only)
|
|
|
|