|
i have an ASP.net textbox on my form and a dropdownlist too on my form. How can i set the text to "hiii" using JavaScript? IS this correct
document.Form1.txtTextBox.value="hiii";
I would also like to set the dropdownlist selected index to 0.
How do I do this? As simple as it may sound just bear withe me guys. i really dont know a !@#$ about JavaScript and this is really urgent. I've learnt my lesson though. Tomorrow i'm going to go my self a really good book to teach me this stuff. In the meantime, it'd be great if you could just help me.
|
|
|
|
|
You'd need to use document.getElementById(myControlId).value='some text'
The thing to watch out for though is that the control name you defined will probably be prefixed with _ctl0_ or something similar. You can use the object.ClientId attribute on the server side to find out what it should be.
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
Hi all
I have a datagrid, which holds item name, item price, and its image(all from SQL Server database), what I need is when the user clicks on the image, I need the (id) for the item to be carried to the new page where I want to show more details about the item (expiry date, ...)
thanks alot
|
|
|
|
|
Hi all,
I am using a datagrid to display some data.The problem is i want to display my own column name rather than those in database.I am using data adapter and dataset to fill data.
Also how can i show only date in the data grid when the contents in the database is date time.It shows date as well as 12AM in addition which i haven`t inserted.
|
|
|
|
|
use this
<br />
<asp:TemplateColumn HeaderText="Date"><br />
<ItemTemplate"><br />
<# FormatDate(DataBinder.Eval(Container.DataItem, "DBDate")) %"><br />
<ItemTemplate"><br />
</asp:TemplateColumn"><br />
Use a TemplateColumn as shown above where DBDate is your database data field. FormatDate is your own function to format date. The function can be like this shown below.
<br />
public static string FormatDate(object oInput)<br />
{<br />
if(oInput != null)<br />
{<br />
if(oInput != DBNull.Value)<br />
return ((DateTime)oInput).ToString("MM-dd-yy");<br />
else<br />
return string.Empty;<br />
}<br />
else<br />
return string.Empty;<br />
}
Hope this will help
Pradipta Basu
|
|
|
|
|
Thank you.
This has helped me a lot.
|
|
|
|
|
:-OYou can use
"select customer as my_lovername from table_name"
Then column will show my_lovername,
wish it can help you!
jeam
|
|
|
|
|
Define a <columns> collection in the grid, then add column definitions, including the HeaderText attribute
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
I'm using CompareValidator to validate a TextBox control in FormView. I want to compare with a Label. I find however that when I select ControlToCompare, the Label isn't listed. The only controls to choose from are TextBoxes. And yes the Label does exist and is visible! Any ideas?
Many Thanks
Maj
|
|
|
|
|
That's because the Label control is not marked with the ValidationProperty[^]. So you either a) customize the label control or b) use a invisible textbox to contain the value beside the Label so that you can validate the textbox.
|
|
|
|
|
hello,
I've build myself a usercontrol with a couple of buttons to which I added event handlers. The control is loaded dynamically using LoadControl() of the Page object. Loading works fine, but the buttons click event in the usercontrol won't fire eventhough the page is posted back. Does anyone know this problem?
thanks a ton, matthias
/matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
is it possible you don't register your event after postback?
Pilo
|
|
|
|
|
Follow these steps to add events to your user control.
a) Declare the event within the user control’s code module
public event EventHandler Click;
b) Create a method to raise the event
protected virtual void OnClick(EventArgs e)
{
if (Click != null)
{
Click(this, e);
}
}
c) Raise the event from within the user control’s code.
private void Button1_Click(object sender, System.EventArgs e)
{
// You can add your code here
// Then call the OnClick method.
OnClick(e);
}
As obvious now, you have to handle this Click event (declared above) on the Host or Parent web form.
Happy Coding
Aleem
|
|
|
|
|
Someone to help me please.
I want a checkbox as part of my gridview and also use the checkbox to select the rows that are checked.
How do know the rowindex of the checked row and iterate thru the checked rows?
t.aransiola
|
|
|
|
|
Depending on the size of the GridView you could try:
foreach(row in gridview)
checkbox = row.findcontrol(check box id);
if(checkbox.checked)
this row is checked
endforeach
Obviously the above will need some interpretation (and off the top of my head I'm not sure whether its the row or the cell that is the INamingContainer?)
|
|
|
|
|
I have an application which communicates with WebServcie.I installed the application and the WS on a srever of test,i've got all the results i'm waiting for.But when I installed the Web site and the WS on the WEBFARM, the Web site did no longer communicate with the WS. The site can communicate with the WS installed on the server of test.And another site installed on a site different from the WEBFARM can communicate with the WS installed on the WEBFARM.
The problem is that the Web site installed in WEBFARM cannot communicates with the WS installed on the same WEBFARM. What to do!
Here is a snapshot of the debugging window showing the emerged errors:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002066
System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431
[WebException: Unable to connect to the remote server]
System.Net.HttpWebRequest.GetRequestStream() +1504445
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
PTF2_EVALTA.InfoAgent.test(String chaine) in d:\BuildAreas\mk_build\PTF2_EVALTA\V0.013\PROJECTS\PTF2_EVALTA\Web References\PTF2_EIDS_WebService\Reference.cs:90
PTF2_EVALTA.WebForm1.Page_Load(Object sender, EventArgs e) in d:\BuildAreas\mk_build\PTF2_EVALTA\V0.013\PROJECTS\PTF2_EVALTA\PTF2_EVALTA_APP\WebForm1.aspx.cs:34
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
mouadh trabelsi
|
|
|
|
|
It is working fine on Development Server Cassini but doesn't work on IIS5.0 and 5.5
|
|
|
|
|
How do you define your custom handler? How do you configure that handler?
|
|
|
|
|
Hi Sandeep,
Please check the code and let me know.
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.Reporting.WebForms
Partial Class Member_Members
Inherits System.Web.UI.Page
Protected Sub btnSearchMember_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearchMember.Click
Dim con As DataAccess = New DataAccess()
Dim conLessons As SqlConnection = con.SQLConnnect()
Dim cmd As SqlCommand = New SqlCommand()
Dim _DataReader As SqlDataReader
Dim _DataSet As DataSet = New DataSetMember()
Dim _ReportDataSource As ReportDataSource = New ReportDataSource()
Try
conLessons.Open()
cmd.CommandType = CommandType.Text
cmd.Connection = conLessons
cmd.CommandText = "Select AutoID, ForeName, SurName From Members Where AutoID=" & TextBox1.Text & ""
_DataReader = cmd.ExecuteReader()
_DataSet.Tables(0).Load(_DataReader)
_DataReader.Close()
conLessons.Close()
ReportViewerMembers.LocalReport.ReportPath = Server.MapPath("~/Member/ReportMembers.rdlc")
_ReportDataSource.Name = "DataSetMember_Members"
_ReportDataSource.Value = _DataSet.Tables(0)
ReportViewerMembers.LocalReport.DataSources.Add(_ReportDataSource)
ReportViewerMembers.LocalReport.Refresh()
Catch ex As Exception
If conLessons.State = ConnectionState.Open Then
conLessons.Close()
End If
End Try
End Sub
End Class
First Time Im getting the report on particular Member but the Second time code is working but cant get the particular member details, its remain same.
1stTime : textbox1 = 5 getting customer details whose id is 5
2ndTime : textbox1 = 6 cant get the details of customer id 6 , reportviewer cant change the customer details, its again showing the customer id = 5
Sarfarj Ahmed
|
|
|
|
|
hi guys..
can anyone provide me some info. on e-billing..i m developing a website which requires credit card transactions online..
|
|
|
|
|
You need PayPal or a Merchant Account from Verisign or your local financial institution like Icici PaySeal in India.
|
|
|
|
|
thanks for ur prompt reply deepak..
i wud try ur suggestions..
|
|
|
|
|
in one crystal report i have one formula field
my formula contains no errors but the answer is not coming.
plse correct the following
local numbervar hours;
local numbervar minutes;
local numbervar seconds;
hours := hour({tbl_jip.start_time}) * 3600;
minutes := minute({tbl_jip.start_time}) * 60;
seconds := second({tbl_jip.start_time});
local numbervar start=hours + minutes + seconds;
local numbervar hours1;
local numbervar minutes1;
local numbervar seconds1;
hours1 := hour({tbl_jip.end_time}) * 3600;
minutes1 := minute({tbl_jip.end_time}) * 60;
seconds1 := second({tbl_jip.end_time});
local numbervar end=hours1 + minutes1 + seconds1;
local numbervar tot=end-start;
local numbervar RemainingSeconds;
local numbervar Hours ;
local numbervar Minutes;
local numbervar Seconds;
Hours := truncate(tot / 3600);
RemainingSeconds := tot - (Hours * 3600);
Minutes := truncate(RemainingSeconds/60);
Seconds := tot - (Hours * 3600) - (Minutes * 60);
totext(Hours,"00") + ":" + totext(Minutes,"00") +":" + totext(Seconds,"00")
where start_time & end_time are the 2 fields in tbl_jip table
Regards
yaso
|
|
|
|
|
What do you want to achieve with this formula? so that we will know what you are expecting to display
t.aransiola
|
|
|
|
|
hi friends
i have three table
one is category with catid and catname
second is product with catid,proid and proname
third is item with proid,itemid,item name,price,...etc
now i want to bind it in below format
category name2
product name
item name1 price ..... .... .... ... ...
item name2 price ..... .... .... ... ...
.
.
category name2
product name2
item name price . . . . .
.
.
i think all of u understand my problem
but i cant get any idea which control i have to use.
plz give me some idea
thanks
pathan
|
|
|
|