|
Please read the forum guidelines and learn how to format code snippets you post. No one is going to read this unformatted garbage
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
My apologies. Here is the formatted code:
Cs:
[System.Web.Services.WebMethod]
public static string SetAppointmentInfo(int key)
{
return "Hello";
}
Aspx:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<div>
<uc1:WebUserControl ID="WebUserControl1" runat="server" />
</div>
</div>
</form>
</body>
</html>
Js:
function WebDayView1_Click(oDayView, oEvent, element) {
alert(PageMethods.SetAppointmentInfo(15, OnSucceeded, OnFailed));
}
function OnSucceeded() {
}
function OnFailed() {
alert("Failed");
}
Cs (user control):
protected void Page_Load(object sender, EventArgs e)
{
this.WebScheduleSqlClientProvider1.Connect("Database=cmRMI;Server=processor;user id=hardus;password=hardus");
this.WebDayView1.ClientEvents.Click = "WebDayView1_Click";
}
Aspx (user control):
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Scripts>
<asp:ScriptReference path="~/scripts/JScript.js" />
</Scripts>
</asp:ScriptManagerProxy>
<igsch:WebScheduleInfo ID="WebScheduleInfo1" runat="server"
onactivityadded="WebScheduleInfo1_ActivityAdded"
onactivitydeleted="WebScheduleInfo1_ActivityDeleted" onactivityupdated="WebScheduleInfo1_ActivityUpdated" >
</igsch:WebScheduleInfo>
<p>
<ig_scheduledata:WebScheduleSqlClientProvider ID="WebScheduleSqlClientProvider1"
runat="server" WebScheduleInfoID="WebScheduleInfo1" StyleSetName=""
StyleSetPath="" StyleSheetDirectory="">
</ig_scheduledata:WebScheduleSqlClientProvider>
</p>
<igsch:WebDayView ID="WebDayView1" runat="server"
WebScheduleInfoID="WebScheduleInfo1" StyleSetName="" StyleSetPath=""
StyleSheetDirectory=""
StyleSheetFileName="C:/Users/Hardus/Documents/Visual Studio 2008/WebSites/toets/ig_res/ElectricBlue/ig_dayview.css">
</igsch:WebDayView>
<igmisc:WebPageStyler ID="WebPageStyler1" runat="server"
StyleSetName="Default" />
|
|
|
|
|
One, you should have editted the original post rather than adding more.
Have you debugged?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Yes, thanks. I've managed to make it work.
|
|
|
|
|
from last two three days i get this error message althoug it was sending mail before no change in code.
The transport failed to connect to the server
|
|
|
|
|
Just a guess, but maybe the server is down, host name has been changed, is being blocked, etc. What have you checked?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
Tach experts ..
I have ne problem where I do not know to solve that...
I have a control that is added in a page. Basically it is a Content Management System.
It selects a new page and can add different controls.
In the control itself, I use a ModalPopupvon Ajax, but who needs a script manager.
Now I wonder whether in the side where the control is already added a ScriptManager exists otherwise I add one.
Here
void AddScriptMagnager()
{
ScriptManager _scriptMan = ScriptManager.GetCurrent(this.Page);
if (_scriptMan == null)
{
_scriptMan = new ScriptManager();
_scriptMan.EnablePartialRendering = true;
_scriptMan.EnableScriptLocalization = true;
if (this.MuMPage.Page.Form != null)
{
foreach (Control ctrl in this.MuMPage.Page.Form.Controls)
{
this.MuMPage.Page.Controls.Add(_scriptMan);
}
}
}
}
I always get the error that a Extendersteuerelemente may not be registered before PreRender.
I appreciate any help and thanks a lot in advance.
modified on Monday, June 21, 2010 9:02 AM
|
|
|
|
|
[CODE] There is a defined tag for this, <pre> implemented by clicking the "code block" toolbar item directly above this textarea. Please correct your post and read the posting guidelines for this site.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Add where are you calling the AddScriptManager method? Obviously no in the PreRender event handler.
The common implementation is to include a ScriptManger in the master page so it is not necessary to be included in child pages and is available for use.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
but what shall i do if there is none available in the master page?
|
|
|
|
|
You wrote the master page correct? Add a ScriptManager! If you did not write the master page then the author probably did not intend for Ajax to be used in this manner
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Nope, i c´ant! This is Standart site for everysite inour CMS.
I'm trying to do exactly that! Just when none is there in the page where I try to add the control at runtime and add a Script Manager.
And i get
Collection was modified; enumeration operation may not execute.
|
|
|
|
|
HELLO, I now have a template contains a script manager.
but I get this error message but still
Extender controls may not be registered after PreRender
|
|
|
|
|
HELLO, the error tells you what to do
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
but what is the right event to put into?
|
|
|
|
|
Can you do nothing on your own?
Go to the address bar of your browser and type, www.google.com, then click GO.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
is already done!
thxs for your helps.
modified on Tuesday, June 22, 2010 3:12 AM
|
|
|
|
|
Hi..
i just open new window using javascript.
Here Code below
function winopened() {
var docprint = window.open("AddCompany.aspx","child","toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,width=1020, height=520");
return true;
}
so its working good if i click to button so new window pop up . its fine but when i try to close to that window direct to browser close button its wont be close i dont know wht the porb..
try and try untill reach success..
|
|
|
|
|
It is very hard to understand what you are trying to say.
To my understanding,
You want to close the Popup Window when the browser Close button is clicked right?
|
|
|
|
|
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 504
|
|
|
|
|
Check these[^].
If it doesn't help, follow steps below:
Can you access the server?
If No, can't help much.
If yes, check IIS logs file at: "C:\Windows\System32\LogFiles\W3SVC1\"
If there is more than one website hosted on your server, W3SVCNumber will differ.
Also check httperr Log file at: "C:\Windows\System32\LogFiles\".
Find related entries and give details.
..Go Green..
|
|
|
|
|
hi , iam using asp.net 2.0 with sql server 2000
in my site if iam using xp operating system all clients are able to upload the pictures but the clients those who are using windows7 and vista the are getting errors
can you correct my code
<%@ WebHandler Language="C#" Class="right7" %>
using System;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
public class right7 : IHttpHandler {
public void ProcessRequest (HttpContext context)
{
string branchid = "";
if (context.Request.QueryString["branchid"] != null)
branchid = context.Request.QueryString["branchid"];
else
throw new ArgumentException("No parameter specified");
context.Response.ContentType = "image/jpeg";
Stream strm = ShowImage(branchid);
byte[] buffer = new byte[4096];
int byteSeq = strm.Read(buffer, 0, 4096);
while (byteSeq > 0)
{
context.Response.OutputStream.Write(buffer, 0, byteSeq);
byteSeq = strm.Read(buffer, 0, 4096);
}
}
public Stream ShowImage(string branchid)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["transfer"].ConnectionString);
string sql = "SELECT imgright7 FROM tblImages WHERE BranchId = @BranchId";
SqlCommand cmd = new SqlCommand(sql, con);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@BranchId", branchid);
con.Open();
object img = cmd.ExecuteScalar();
try
{
return new MemoryStream((byte[])img);
}
catch
{
return null;
}
finally
{
con.Close();
}
}
public bool IsReusable {
get {
return false;
}
}
}
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class right7image : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["transfer"].ConnectionString);
string branchid = "";
protected void Page_Load(object sender, EventArgs e)
{
branchid = Session["UserName"].ToString();
if (IsPostBack == false)
{
Image1.ImageUrl = "right7.ashx?BranchId=" + branchid;
Image2.ImageUrl = "right7old.ashx?BranchId=" + branchid;
}
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("Images.aspx");
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmdptr = new SqlCommand("copyprevimgr7", con);
cmdptr.CommandType = CommandType.StoredProcedure;
con.Open();
cmdptr.Parameters.AddWithValue("@BranchId", branchid);
cmdptr.ExecuteNonQuery();
con.Close();
SqlCommand cmdupdate = new SqlCommand("updateright7", con);
cmdupdate.CommandType = CommandType.StoredProcedure;
con.Open();
cmdupdate.Parameters.AddWithValue("@BranchId", branchid);
if (FileUpload1.HasFile)
{
FileInfo left1info = new FileInfo(FileUpload1.PostedFile.FileName.Trim());
byte[] left1content = new byte[left1info.Length];
FileStream left1stream = left1info.OpenRead();
left1stream.Read(left1content, 0, left1content.Length);
left1stream.Close();
cmdupdate.Parameters.AddWithValue("@imgright7", left1content);
}
cmdupdate.Parameters.AddWithValue("@noter7", TextBox1.Text);
if (cmdupdate.ExecuteNonQuery() != 0)
{
con.Close();
clsdatasettransfer.ShowAlertMessage("Updated.....");
TextBox1.Text = "";
System.Threading.Thread.Sleep(2000);
Image1.ImageUrl = "right7.ashx?BranchId=" + Session["UserName"].ToString();
Image2.ImageUrl = "right7old.ashx?BranchId=" + Session["UserName"].ToString();
}
else
{
clsdatasettransfer.ShowAlertMessage("Updatefailed");
}
}
}
|
|
|
|
|
developerit wrote: clients those who are using windows7 and vista the are getting errors
What error they are getting ?
|
|
|
|
|