|
Hi !
And thanks for answering me !
I'm sorry for my confusion between AJAX and MS AJAX ... Maybe they should have kept "Atlas" as the Framework name to avoid mistakes ...
In fact I'm not a Javascript fan, and never was ... The MS AJAX seemed to be a good solution for me, as it could give me the ability to use AJAX benefits without wondering about how it is implemented behind ...
My first try was to put in an UpdatePanel, a textbox and a button. In the eventhandler of the button, using C# code in the codebehind file, I put a statement like this :
<br />
protected void btnUpdate_Click(object sender, EventArgs e)<br />
{<br />
txtTest.Text = "This is a test";<br />
}<br />
At runtime, a click on the button generates a PostBack but the page doesn't move, only the textbox gets some text in it.
Then, to ensure a linkbutton can do that, I've added a link button in the same UpdatePanel. Here is the code :
<br />
protected void lkbAnotherTest_Click(object sender, EventArgs e)<br />
{<br />
txtTest.Text = "Link clicked";<br />
}<br />
The same : at runtime, the click on the linkbutton generates a postback but with the "AJAX behaviour", only the textbox got some text in it, the rest of the page didn't move.
But when I put a WebControl self made which is composed of a table with rows and cells themselves composed of many linkbuttons, at runtime, when I click on a linkbutton of my WebControl, the whole page gets refreshed ... I'm then wondering why ! And how I could get it work !
|
|
|
|
|
Hi,
I am working with Asp.net 2.0 (VB.NET)
I am getting a Exception :System.Threading.ThreadAbortException
at
Response.Redirect("Searched.aspx")
I have tried using below all code but I am getting the same exception
Response.Redirect("Searched.aspx", false);
Response.Redirect("Searched.aspx", true);
Response.Redirect("Searched.aspx");
Please help.
|
|
|
|
|
Sounds like you are trying to redirect at the wrong point in the page flow. What event are you trying to call Response.Redirect from?
|
|
|
|
|
|
|
Thanks you very much, Got it done
|
|
|
|
|
I deploy a web application which is running fine on my computer but giving dz error on my web server (host server) . I used C# and MySql as database.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 20: <compilation debug="true">
Line 21: <assemblies>
Line 22: <add assembly="MySql.Data, Version=5.0.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D">
Line 23:
|
|
|
|
|
I ve been able to solve the problem thank so much. I just copiy MySql.Data.dll file to bin folder on the host server and that is it. Thank you so much. I m very grate ful.
|
|
|
|
|
I'm thinking that this isn't possible, but it can't hurt to ask. I'm trying to create a custom server control that takes a generic type, so for example:
public class MyControl<T> : WebControl { ... }
This works fine and I can create the control programmatically in the code behind file like so:
MyControl<Type> MC = new MyControl<Type>()<br />
MyForm.Controls.Add(MC);
I was wondering if there is any way to do that non-programmatically through the visual studio page designer. When I add it to the toolbox it shows up as: MyControl`1 which is the syntax used for a class with one type parameter, but when I try to drag it onto an aspx page it says: Element 'MyControl' is not a known element. If anyone knows how to do this I'd appreciate the info. Thanks.
- Matt
|
|
|
|
|
hi
i want to create asp.net user with code without using CREATEUSER WEBCONTROL.
how i can do this...
thanks
|
|
|
|
|
Can anyone reccomend something?
I didn't get any requirements for the signature
|
|
|
|
|
|
Hi.
How can I convert a aspx page to html page in code ?
i.e. I want to create an html page in code, not only creating a file but writing it source code that it's source is result of execution of an aspx file?
Best wishes
|
|
|
|
|
You can consdier creating a stringbuilder object first and then add the HTML tags to it like as follows ones you have have it done send it to the browswer and it will render it for you.
StringBuilder sb = new StringBuilder();
sb.Append("<body");
sb.append("< body="">");
|
|
|
|
|
Wow, I'll have answered two questions with the same link within 5 minutes of each other. How can you get any better than that?
Take a look at the HTMLDocument[^] object.
|
|
|
|
|
Hi guys, I am counting Items on button click if total items are 5 then i want to display a popup or alert message through javascript. Currently i am calling in my button click event like this:
button.OnClientClick="javascript:alert('5 Items');";
The problem is I had to click twice to invoke this message. lets say the counter is 5, I clicked on messages appears, I clicked again then I do see this message. Can someone help me in it.
Thanks
|
|
|
|
|
you can try putting this under Button_Click event
Response.Write("javascript:alert('5 items');");
|
|
|
|
|
Thanks for answering. Acutally i have created those button inside an ajax updatepanel. That's y i couldn't use response.write method becuase it throws exception. Is there anyother way.
Thanks
|
|
|
|
|
Here's what I would do (note: ItemCount is a property I have wired to a Session value, you could easily make it a database driven value).
protected void Button1_Click(object sender, EventArgs e)
{
ItemCount += 1;
if (ItemCount == 4)
Button1.Attributes.Add("onClick", "alert('5 Items');");
else if (ItemCount == 5)
Button1.Attributes.Remove("onClick");
}
|
|
|
|
|
I tried but doesn't work. I only want to display the javascript alert box when there are 5 or more itmes . As i mentioned before
button1.attributes.add("onclick","javascript:alert('5 Items');");
display alert message when i click on twice. Please help me and am stuck dont' know how to solve this issuse.
|
|
|
|
|
The code I provided above will add the onClick event after you've clicked the button 4 times. So that means on the 5th click, the onClick event will cause the alert() to show. Then I remove the onClick event because you only wanted to show the alert() on the 5th time. I've tested this code locally and it works fine. Can you show us more of your code so we can see where the problem really is?
|
|
|
|
|
Hi I am new to Asp.Net as I have done in my previous programming ASP and also I did medium work on C# as well so in future i will be using C# with ASP.net.
the main query here is i created two textbox controls and one button when i want an action it goes to c# file. Do we have to write all these actions code in C# file or ASP.Net as well.
Also can anybody help me in starting a good tutorial which explains starting process for me. I dont want to go in to many details of using different controls for ASP.Net because that I will learn from time to time as i just want to do one or 2 application and then moving to ADO.Net and will try to create some good 3 tier architecture web applications using SQL Server 2005.
I will be very thankful to you.
Thanks
|
|
|
|
|
shah123 wrote: Do we have to write all these actions code in C# file or ASP.Net as well.
ASP.NET is a class framework, you're going to use C#, so the question makes no sense.
You'd handle the click event, interact with your control in your code behind, and use the same code you would in winforms to write your file.
shah123 wrote: Also can anybody help me in starting a good tutorial which explains starting process for me.
The main thing to understand, is that the C# code runs on the server, not the client. You can't write C# code that runs client side. You create javascript and HTML for the client. Other than that, I'd buy a good book if you need an overview, or just download some articles and look through them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
|
Hi,
I'm creating several web application projects but i want them all the share a common membership. currently each application has a seperate web.config file with the same membership details. I have 1 logon.aspx page which i want all applications to redirect too.
However at the moment the main logon application works fine, and the other applications redirect to it for logon but it just gets stuck on the logon page. What i think is happening is application B redirects to the logon page in appalication A the user logs on then it trys to redirect them back to the application B but looses the logon details which causes the application B to redirect them back to the logon in application A again. Hope that makes sence.
I think the problem lies in my web config file but i'm new to all this and would appeciate any help you can give.
I have this web config in both applications
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<connectionStrings>
<add name="MySqlConnection" connectionString="..." />
</connectionStrings>
<system.web>
<compilation debug="true" />
<authorization>
<deny users="*" />
</authorization>
<authentication mode="Forms">
<forms loginUrl="/AppA/logon.aspx" enableCrossAppRedirects="true" name=".ASPXFORMSAUTH" path="AppA" />
</authentication>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15" >
<providers>
<clear />
<add minRequiredNonalphanumericCharacters="0"
name="SqlProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="MySqlConnection"
applicationName="AppA"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
requiresUniqueEmail="true"
passwordFormat="Hashed" />
</providers>
</membership>
<profile defaultProvider="SqlProvider" enabled="true">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="MySqlConnection" applicationName="AppA"/>
</providers>
<properties>
<add name="Title"/>
<add name="Forename" />
<add name="Surname" />
<add name="Department" />
</properties>
</profile>
<roleManager enabled="true" defaultProvider="SqlRoleProvider">
<providers>
<clear/>
<add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="MySqlConnection"/>
</providers>
</roleManager>
</system.web>
</configuration>
no one ever said they wished they would have worked more on their death bed.
|
|
|
|