|
I am trying to use the ICallbackEventHandler interface.
I create a callback function as below:
string src = Page.ClientScript.GetCallbackEventReference(
this,
"arg",
"ClientCallback",
"ctx",
"ClientErrorCallback",
false);
string mainSrc = @"function PrintComplete(arg, ctx)
{alert(arg); " + src + "; }";
Page.ClientScript.RegisterClientScriptBlock(
this.GetType(),
"PrintComplete",
mainSrc,
true);
Now I add a button to my page and hook it up to a click event handled on the page along with the callback funtions.
test
function ClientCallback(result, context)
{
alert(result);
}
function ClientErrorCallback(error, context)
{
alert("Error in callback");
}
function test()
{
PrintComplete(5, "test");
}
This all works fine. Now if I try to call the test function from another script created with RegisterClientScriptBlock I get the call into PrintComplete but no call back to the server.
Any ideas? Is there a difference when running a script on the page versus a RegisterClientScriptBlock script?
Thanks,
Todd
|
|
|
|
|
If you run code from a block created with RegisterClientScriptBlock, the code will run while the page is loading. The only things that are available at this time is in the code above the script.
There are three possible reasons why the postback doesn't work:
:: The function for callback hasn't been written to the page yet.
:: The form fields used by the callback hasn't been written to the page yet.
:: The form is not fully loaded, so it can't be posted.
I don't know exactly which of those three that is the actual reason. Either way, the reason that it doesn't work is that you are trying to make the postback before the page is complete.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I am Ravindra ,new to ASP.net and when I tried to work with adrotator
adds are not displaying with moving banners ,they are displaying just
like an ordinary image .
please, anybody help to work with adrotator (with moving
banners).
ravindra
|
|
|
|
|
hi,
Ravindra adrotator provided in .NET studio doesnot provides you the feature you are looking for. In .NET adrotator, images are changed when the page is refreshed.
If you want this functionality that the images change automatically, then you have to use javascript( Preload images) or Ajax.
Thanks
Sushant Duggal.
|
|
|
|
|
Hi
I have developed a site of Sale/Purchase of Vehicles. We put vehicle's information on other site like greatvehicles.com, ebay, vroom.com etc.
Now when a user update its Vehicle Information from his account I need to keep track what information he has changed(eg Make, Model, Photos etc). I need to keep last 5 updates made by user.
Please suggest me any koool suggestions to handle it. Please let me know if you need further information regarding this.
Thanks in advance
Lets work it Out.........!
|
|
|
|
|
create a table on database say vehicle_history (the fields that you need to keep track of and a number showing the history id)
create a update trigger on original table and insert (if the number of records for that vehicle is <5, or insert + delete the oldest or the one with smallest history id).
Thats it...
Hain Kurt
|
|
|
|
|
Thanks a lot..!
Lets work it Out.........!
|
|
|
|
|
I am writing an application that uses Web Parts that are controlled via custom editor drop down lists. The problem I have is in getting the new data to be saved in the personalized DB. The Personalization state is set to 'shared'.
Do I need another class to read the new variables and save them to the DB?
Thanks in advance for any help or suggestions.
Cheers,
A Seattle Seahawk fan,
Lil Turtle
|
|
|
|
|
Hi there....
I have a page in which i have several usercontrols. In some of the usercontrols I am generating checkboxes, textboxes etc for x number of customers to capture their details. in my main page, i would like to retrieve the values that are posted. I have attempted to use Page.FindControl(...) however i keep getting object not declared. Since the controls are dynamically created, .net creates for example an arbitary name "ctl00_cphBookingWizard_ucPassengerProductConfigure1_UcPassengerProducts2_gvwProducts_ctl02_chkInclude"
for a checkbox which is id'd by chkInclude in my code.
My question(s): 1. Is there a way to retrieve dynamically generaty controls such as checkbox if .net appends to the control id?
2. DO i have iterate through the page to do a control compare in order to capture the values i need (really not efficient way of doing things!)?
Tx
Orb
|
|
|
|
|
You would be better to place properties on the user controls that contain these controls to find the values. Or you can use myUserControl.FindControl to find the controls within them by their design time id.
|
|
|
|
|
I'm looking for a free open source* RTE (Rich Text Editor).
I'm looking for a ASP.NET component.
If anyone have any links that might help me, I would that him soooooo much!!!
Thanks in advanced... SOOOOOOOOOOOOOOOO Muchh.....
*Open source = A component that I can edit the style\looks of it, so I can change his appearens to my needs.
NaNg.
|
|
|
|
|
I'd like to see if anyone here uses anything other than FCK Editor:
http://www.fckeditor.net/
It's the best opensource, cross platform one available... Someone's even started an opensource .NET component for extra easy integration
|
|
|
|
|
I have a nested datagrid. Because of the way the information is set up in the database, I have separate SQL queries to populate the grid:
private void BindData()<br />
{<br />
strPartNumberInputReference = txtPartNumberInput.Text <br />
string SQLString = "SELECT p.PartNumber, p.ID as ptID, pt.description, dd.DrawingNumber, dd.DrawingRevision, dd.DwgPath FROM parts p INNER JOIN PartTypes pt on pt.ID =p.PartTypeID LEFT JOIN DraftingData dd on dd.PartID = p.ID WHERE p.PartNumber = @PartID;SELECT w.weight, wt.Description AS wtDescription, p.PartNumber from weights w INNER JOIN weighttypes wt on wt.ID = w.weighttypeid INNER JOIN Parts p on w.PartID = p.ID WHERE p.PartNumber = @PartID;SELECT c.cost, p.PartNumber, ct.Description AS ctDescription from Costs c INNER JOIN Parts p ON c.PartID = p.Id INNER JOIN CostTypes ct on ct.Id = c.CostTypeID WHERE p.PartNumber = @PartID; SELECT s.SubPartID, s.Quantity, s.Sequence, p.PartNumber FROM SubParts s INNER JOIN Parts p ON s.PartID = p.Id "; <br />
SqlCommand cmd = new SqlCommand();<br />
cmd.Connection = new SqlConnection(strConnectSQL);<br />
cmd.CommandText = SQLString;<br />
cmd.Parameters.Add ("@PartID", strPartNumberInputReference);<br />
SqlDataAdapter adapter = new SqlDataAdapter(cmd);<br />
adapter.Fill(ds);<br />
<br />
ds.Tables[0].TableName = "Rest";<br />
ds.Tables[1].TableName = "Weights";<br />
ds.Tables[2].TableName = "Costs";<br />
ds.Tables[3].TableName = "Subparts";<br />
<br />
<br />
dgParts.DataSource = ds;<br />
dgParts.DataBind();<br />
txtPartNumberInput.Text = "";<br />
<br />
<br />
}
Using these separate table names is how I populate the three nested datagrids.
I have a button for the user to click to add a new blank row for the main datagrid (called "Rest"). I've been messing with it for several hours and get one error or another.
Currently I have:
private void add_Click(object sender, System.EventArgs e)<br />
{<br />
DataTable dt2 = ds.Tables["Rest"];<br />
DataRow row;<br />
row = dt2.NewRow();<br />
row.ItemArray = dt2.Rows[0].ItemArray;<br />
row["PartNumber"]=strPartNumberInputReference = txtPartNumberInput.Text;<br />
row["DrawingNumber"]=DBNull.Value;<br />
row["DrawingRevision"]=DBNull.Value;<br />
row["DwgPath"]=DBNull.Value; some additional code...
but I'm getting the error "There is no row at position 0."
How should I be programming this?
|
|
|
|
|
hi,
its probably because you are creating the new row but not adding it to the table.write dt2.Rows.Add(row)
Tirthadip
|
|
|
|
|
Hi
I am developing a web application in which i am writing a file in javasript then after reading the file i have to delete the file but while deleting the file it gives error Permission denied .
PLease help me
hevar strContents; strContents = "";
objFSO = new ActiveXObject("Scripting.FileSystemObject");
if (objFSO.FileExists(strFileName))
{
var objFile=objFSO.OpenTextFile(strFileName, 1);
while ( !objFile.AtEndOfStream )
{
strContents = objFile.ReadLine();
var temp=strContents.split("#");
var range=temp[0];
var address=temp[1];
AddItemToListBox(range,address);
}
objFile.Close ();
objFSO.DeleteFile(strFileName,true); }
red line gives error
|
|
|
|
|
Hi,
I would like developp a control treeview with asp.net with the possibility to research a text in the treeview. The research must work all the node of the treeview.
Have you a exemple, a tutoriel ?
Thanks of your response
|
|
|
|
|
try telerik treeview component... they are really working nice and fast... You can find the documentation and tons of running samples...
Here is a part from documentation (r.a.d.treeview Client-Side):
FindNodeByText(text) Returns the first instance of a node with the specified Text.
FindNodeByValue(value) Returns the first instance of a node with the specified Value.
HainKurt
|
|
|
|
|
Hello,
I am in a little pickle, as usual and need to point to this asp file from within my asp.net page, but I get errors each time I do a dry run of my app... it didn't work even after I added the following attribute to the Page directive of my asp.net file:
AspCompat="true"
Can somebody please help me out? Many many thanks in advance!!
-Nila
|
|
|
|
|
How to display a row of elements from a datagrid to next page using querystring.
|
|
|
|
|
hi all
select date from table
which date format return . i want to show the date in dd/mm/yyyy
pls send the solution.
Regards
Srinadan mall
-- modified at 10:20 Monday 26th June, 2006
|
|
|
|
|
It depends on what you are doing?
If you want the date formated when returned from your database query you can use the CONVERT function: CONVERT( VARCHAR(10), date, 103 )
If you want to format it after the results are returned, such as using a GridView, then you can use the format specifiers in that control.
|
|
|
|
|
If I wanted to create an ASP.NET app for use on our internal network that would list all computer names on the network, and other info on the workstations such as hardware and software installed, how could this be done? Would I need to create an object to reside on the server which ASP.NET could then call the objects functions to crawl the network for this info save it to a database, and then let ASP.NET create reports from the database? Anythoughts on the best way to do this.
|
|
|
|
|
I'm certain there is a way of doing this using Windows Management Instrumentation (aka WMI) though I'm not directly experienced using this technology. You could start by checking out WMI on MSDN though I'm sure that won't be all ya need to get started.
-swilly1
|
|
|
|
|
I m saving certain amount in database and i want when it is displayed back then there should be comma after every three digit.I m doing this application in asp.net.I dont want to change column type from number to varchar.That i have done already.I want that column type should be number only but it should display amount having comma after every three digit
thanks
varun
|
|
|
|
|