|
System.Web.UI.Control i guess.
|
|
|
|
|
If it's a webform, your base class should inherit from System.Web,UI.Page .
|
|
|
|
|
Hi All
I developed my website in asp.net 2.0. i used master page. there are top menu and left menu in website.
left menu are related to particular top menu. when i click on any left menu page open there.
On the page there is some textboxes and other server controls. I insert some values in textboxes and click ADD TO Grid button. Then all values added temporarily to
the gridview below. like this user can add many rows in grid. after that he can save all rows in database on a single click of SAVE button. I used Datatable to bind gridview.
But if user added the rows in grid view and rather than pressing SAVE button he click on other top menu or left menu.
in this case there should be a message box when he click to another top or left menu. message like this - Do you want to save the records ?
if user click yes then control must be on the same page or data must be saved otherwise open the other menu.
Google (Gmail) also provide such type of facility, when you write some text to send but you do not send the message then there is also message box like
Do you want to Save this message as draft or Discard the message ?
I also want to do such type of activity.
Your answer is appreciated.
|
|
|
|
|
i found this type of facility in code project itself also.
|
|
|
|
|
Hi,
I want to implement a feature like Gmail. When in Gmail, we compose email and without sending a mail, we click other link menu like Inbox, Chats, Drafts , one pop up is displayed with description “Your message has not been send. Discard your Message? Two button like OK and Cancel. Similar feature like Gmail pop up I want to implement in my application.
My queries are:-
I have 10 records in grid view bind with Datatable.This rerecords are temporary store in session. There are two button like “save” and “cancel”. When user clicks the save button record goes to database. But suppose, records are available in grid view and user click other menu or link button. Then in this scenario I want to display a pop up message for user,” do you want to save or discard the record in grid view.
I need your help, how can I do or implement this in my application.
Regards
Rajesh
rajesh
|
|
|
|
|
Hey Rajesh,
Don't just look only Google. We also have like that in our CP.
Have you never seen the text as below??
Are you sure you want to naviate away from this page?
You will lose any unsaved text. Is this OK?
Press OK to continue, or Cancel to stay on the current page.
You can attach the javascript function in "onbeforeunload" event.
|
|
|
|
|
|
Hi All,
I have got some web pages which can be seen properly (with the style sheets applied to the page's contents) from the domain i am working on. But when others from a different domain or when accessed from anywhere else, the page seems to be missing its style sheet.
Can anyone please suggest some possible solutions so that i can try it out to tackle this?
Thanks & Regards,
Payal
|
|
|
|
|
Payal_e_m wrote: when others from a different domain or when accessed from anywhere else, the page seems to be missing its style sheet
the page from different domain is missing the CSS, right? Are you also working on that different domain? If you are not working on that then why you care? For example, you try to access the google homepage. The google homepage looks disorder. but what do you want to do about that? sooner or later, Google will fix their homepage..
|
|
|
|
|
I have spun my wheels already. I have also looked pretty much everywhere for my specific use case but I have not been able to find anything that helps me. Please help.
I have an ASP.NET page embedding an unmanaged C++ OCX within the page using the following code.
[code]
<%@ Page AspCompat="true" Language="C#" AutoEventWireup="true" CodeBehind="Anywhere.aspx.cs" Inherits="Anywhere_Example_CSharp.AnywhereExample" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script runat="server" language="C#">
public void btn1_Click(object sender, EventArgs e)
{
mycontrol.AddUnconnected(10, 10, 0, 0);
}
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Add Person" OnClick="btn1_Click" />
<OBJECT id="mycontrol" style="WIDTH: 773px; HEIGHT: 488px" classid=clsid:F3AA9E66-A723-11D2-A17D-0060975A5AFA>
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="20452">
<PARAM NAME="_ExtentY" VALUE="12912">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
<asp:Label id="lblMessage" runat="server" />
<asp:PlaceHolder id="phMyPlaceHolder" runat="server" />
</form>
</body>
[/code]
The control get displayed properly. The trouble comes when I try to get access to the API functions in the OCX with ID "mycontrol". What I wanna do is call the method mycontrol.AddUnconnected(0, 0, 0, 0) on the OCX. Unfortunately this is not working.
In fact if I have function
[code]
public void btn1_Click(object sender, EventArgs e)
{
mycontrol.AddUnconnected(10, 10, 0, 0);
}
[/code]
not commented out as shown, the page is not displayed whereas if I comment out the line
[code]
mycontrol.AddUnconnected(10, 10, 0, 0);
[/code]
The page is displayed and the control works fine, except I cannot call the API functions.
How do I make the control that has been embedded inside a page using the <object> tag as shown above accessible to my server side controls / and server side scripts?
Your help is appreciated.
Thanks,
Melody
|
|
|
|
|
Somebody sure has embedded a C++ OCX in ASP.NET. SOS.
I have found a way to do by using javascript injection but that is not adequate. And even if that worked I still have a problem with passing values that are set using JavaScript back to the server.
Example code below
<br />
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{ <br />
{<br />
<br />
string ls_script = "<script language=\"JavaScript\">";<br />
ls_script += "\n";<br />
ls_script += "<!--";<br />
ls_script += "\n";<br />
ls_script += "function AddUnconnected() { ";<br />
ls_script += "\n"; <br />
ls_script += "\n"; <br />
<br />
ls_script += "var ocx = document.getElementById(\"progeny\"); \n"; <br />
ls_script += "if (ocx != null) { \n";<br />
ls_script += " var upn = ocx.AddUnconnected(0, 0, 0, 0); \n";<br />
ls_script += " var mom = ocx.AddPerson(upn, 2, 0); \n";
ls_script += " var pap = ocx.AddPerson(upn, 1, 0); \n";
ls_script += " ocx.SmartDraw();\n";<br />
<br />
<br />
ls_script += " var xml = document.getElementById(\"XMLSTRING\"); \n";<br />
ls_script += " if (xml != null) xml.innerText = ocx.GetXMLString(); \n";<br />
ls_script += "} \n";<br />
ls_script += "alert(\"Nuclear Family Created\"); \n"; <br />
ls_script += "}";<br />
ls_script += "\n";<br />
ls_script += "// -->";<br />
ls_script += "\n";<br />
ls_script += "</script>";<br />
this.Page.RegisterClientScriptBlock("AddUnconnected", ls_script);<br />
<br />
this.Button1.Attributes.Add("onclick", "AddUnconnected()"); <br />
} <br />
}<br />
|
|
|
|
|
Hi everyone, since I'm an ASP newbie, can you recommend a good article dealing with writing at the server side?? Take guest book postings as an example in which a page would write text from a text box down to a file in the server..
A quick tip about how to do it would be appreciated!
Thank you guys!
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
You can use standard C# code to write to flat files, but a guestbook is far more likely to write to a database.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian,
Christian Graus wrote: You can use standard C# code to write to flat files,
Really?? And that would write at the server side not the client side?? Using the same read/write streams from IO??
I'll try it now, thanks Christian
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi all,
assuming that we have an FormView which is binded with an ObjectDataSource, which provide a List<myobject> list as SELECT result.
The list provided by the ObjectDataList is composed by some object of MyObject class, which is the following:
class MyObject
{
int a;
int b;
InnerObject oInner;
}
The InnerObject class is the following:
class InnerObject
{
int alpha;
string bravo;
}
I would like to bind the Text property on a asp:label object with the MyObject.oInner.bravo string, using the Eval().
Have you any idea about I can do it? Is it possible?
Thanks a lot
Regards
Federico
|
|
|
|
|
Yes, just bind to it as normal. Instead of binding to MyProperty, bind to oInner.bravo.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello Christian,
thanks for your reply. The Bind("oInner.bravo") works only with a Label in my FormView's ItemTemplate. If I try to use it in a DropDownList like the following:
<asp:dropdownlist id="ddlCategoriaCorsoEdit" runat="server" datasourceid="odsCategorie" datatextfield="Titolo" datavaluefield="ID" selectedvalue="<%# Bind("oInner.bravo") %>
I got a build error: "Unknow server tag" in the ASPX page
<uc1:visualizzacorso id="VisualizzaCorso1" runat="server" />
where VisualizzaCorso is my formview.
Have you any idea how it happens??
Regards
Federico
|
|
|
|
|
Hi,
I'm new to asp.net and using IIS in general.
I followed the steps at http://www.builderau.com.au/strategy/architecture/soa/Utilise-Web-services-in-the-real-world/0,339028264,339130846,00.htm[^]
- used wsdl.exe to generate a .cs file from the wsdl file.
- compiled the .cs file into a dll.
I installed IIS on my WinXP. I think it installed IIS 5.1. I tested sample asp.net vb and c# aspx code and it works fine.
My question is, where do I place the generated DLL? I have the sample.aspx that uses the DLL in the C:\Inetpub\wwwroot itself. I placed the DLL in this directory itself, but when I run the aspx, I get an error with the following line in aspx:
]]>
CS0246: The type or namespace name 'SampleNS' could not be found (are you missing a using directive or an assembly reference?)
It looks like it is not finding the DLL. Where am I supposed to place the DLL? I created a bin directory under C:\Inetpub\wwwroot and placed the dll there, but that didnt help either.
Can someone help?
Thank you so much.
--c_s_k
|
|
|
|
|
Actually, you can just add the proxy class to your webproject.. If you already compile it as a dll, you can add it as a reference in your webproject.. then it will be automatically copied to your bin folder..
|
|
|
|
|
I dont have a web project, developed in visual studio. I'm yet to learn that.
I compiled the dll manually, and created the aspx manually the following the instructions at the above links.
so all I have is a dll and a aspx file. I have built these manually and might have made mistakes.
Are there any other tutorials to do something similar?
thanks.
|
|
|
|
|
Actually, if you are using Visual Studio 2005 or 2008 Express then it is more easier for you to do that thing.. You can download it from this link http://www.microsoft.com/express/vwd/[^]
then, create the new webproject. Add your webservice as web reference in your web project..
|
|
|
|
|
Michael,
Thanks for the pointer. I have visual studio 2008. I will take a look on using it.
Meanwhile, can you take a look at the following and see if you can figure out what's going wrong?
This is what I am doing:
1. wsdl /out:LocalTime.cs /n:LocalTimeNS http://www.ripedev.com/webservices/LocalTime.asmx?WSDL
2. csc /t:library /out:LocalTime.dll /reference:System.Web.Services.dll LocalTime.cs
3. Place the DLL in C:\Inetpub\wwwroot\bin.
4. Place the following code in localtime.aspx and place it in C:\Inetpub\wwwroot
<code>
<![CDATA[<%@ Page language="c#" %>]]>
<![CDATA[<%@ Import Namespace="LocalTimeNS" %>]]>
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e) {
LocalTime testService = new LocalTime();
this.txtTemp.Text = testService.LocalTimeByZipCode("40243");
}
</script>
<html><head>
<title>Builder.com Web Service utilisation example</title>
</head>
<body>
<form id="frmWSExample" method="post" runat="server">
<asp:textbox id="txtTemp" style="Z-INDEX: 101; LEFT: 224px; POSITION: absolute;<br mode=" hold=" />TOP: 64px" runat="server" />
<asp:label id="lblOutput" style="Z-INDEX: 102; LEFT: 32px; POSITION: absolute;<br mode=" hold=" />TOP: 64px" runat="server" width="176px">The current time is:</asp:label>
</form></body></html>
</code>
Note that the codeproject server is adding CDATA and adding an extra space in each html tag above. The code I am using is following the example at http://www.builderau.com.au/strategy/architecture/soa/Utilise-Web-services-in-the-real-world/0,339028264,339130846,00.htm
5. Access the aspx using the url http://localhost/localtime.aspx
6. This gives the error refering to the line 2 in the code above(Import Namespace="LocalTimeNS"):
CS0246: The type or namespace name 'LocalTimeNS' could not be found (are you missing a using directive or an assembly reference?)
Thanks!
--c_s_k
|
|
|
|
|
I figure out what was needed to get this working. I created a sample site using visual studio 2005 and looked the site properties.
- create a folder called foo
- place the localtime.aspx in foo
- create a foo\Bin and place the dll in foo\Bin
- In the IIS manager, open the properties of foo under that is under the default site
- Under the Directory tab, create an application for this folder.
- Under the ASP.NET, change the version number from 1.xxx to 2.xxx.
With this, http://localhost/foo/localtime.aspx works fine.
|
|
|
|
|
I have used datagrid to display data on a web page. Does anyone know how to use the sleep function in vb.net to display data using time intervals.
for example first entry came in at 16:02:01 and the second at 16:02:21 instead of displaying both entries at once i want it to display the first entry then wait 20 secods to display the second entry.
I hope i have made the problem clear.
|
|
|
|
|
You need to buy a book on ASP.NET and read it, so that you understand what it is, and how it works. Your VB.NET code runs on the server, there's never a good reason to use sleep there. You can write a timer in javascript, which is the language that runs on the client, which uses AJAX or just forces a refresh to update your data.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|