|
Please clarify your question. And what, if any, error you are getting
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
HI,
I was wondering what is the best practice when you will use this control
1. to create each page as a control and used the control in ajaxToolkit:TabPanel
2 implement all the pages direct in the ajaxToolkit:TabPanel
This is a case when the pages are not simple pages.
Thank You
Florian
|
|
|
|
|
Hi,
1) I want to place the button in wizard control which shoul repeat for every step(regardless of Start, Step, Finish). Where to put the button code in Wizard?
2) How to hide the Wizard steps based on the user roles?
Thanks in advance
|
|
|
|
|
Best option, to create your own custom Wizard !!
|
|
|
|
|
Hi,
This probably has been asked before but I haven't found an answer ...
i displayed data into Table control programmatically, and added the linkbutton control to table cell and now i have to bind data or display detials of record in formview when user click linkbutton .
i can insert ,delete,update the data into formview but problem is that how i display data into formview when user clicks button otherwise formview visibility would be false.
how i set mode of formview by default for data display?
how i write event handler for linkbutton to display data into formview control ?
please give me solution or hint for this problem iam stuck on this .
any link or Article is higly appercited.
Best Regards
Rameez
|
|
|
|
|
1. how i set mode of formview by default for data display
Ans: On design time set its visibility to false. And when the user clicks the button set it to true.
2. how i write event handler for linkbutton to display data into formview control
Ans: yourLinkButtonName.Click += new EventHandlerNAme
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Thanks for reply ,
problem is that how i display data inside formview on linkbuton click .
i know i have to use item template for doing this but how programatically i do this.
iam able to delete,update ,display data inside formview using templates but now i want to display data into formview on linkbutton click . i have created linkbutton programmatically .
please give me suggestion or any link ?
regards
Rameez
|
|
|
|
|
Hi,
I have one Applications.aspx page. There are 5 types of applications. I am using the Applications.aspx to process the 5 types of applications. So For the Application type 1, I need to show some fields which are not applicable to other application types. some of the input fileds for the applicationtype 2 are not applicable to remaining application types.
How to put the conditions in aspx page to show the necessary fields nased on the application type in one aspx page?
What is the best solution for this type of requirements?
Thanks in advance
|
|
|
|
|
Writing code and setting the visible property of either fields, or user controls, depending on how complex the differences are.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I* have so many controls for each application type. Setting visiblity for all the controls depending on application type will result in many lines of code. Insted of this approach, can we write the condition in aspx page like <% applicationtype > controls related to this type?
Thanks
|
|
|
|
|
No, I'm afraid you reach a point in life where you have to write actual code. How many lines can it take to show one of five different controls ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Put the controls in a PlaceHolder and show/hide the one placeholder depending on condition.
|
|
|
|
|
you hjave to check condition for your application and based on that just show your controls.
e.g
protected void Page_Load(.....)<br />
{<br />
if(Condition of Application1)<br />
{<br />
} <br />
else if(Condition of Application2)<br />
{<br />
} <br />
.<br />
. <br />
} you can also Switch statement for that
|
|
|
|
|
Another way is to create different user controls for different applications types
And load one og these user controls at run time depending on our business logic
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
I'm new to web development and asp.net and can't figure this one out.
I've manually created a datatable in my dataset.xsd page and now I want to bind a gridview to that datatable. I need to do this so I can design the gridview at design time and manipulate it at runtime. I will be populating the datatable at runtime as well.
I can't see how to create a suitable datasource to link to the table?
Can someone point me in the right direction please. Obviously I'm coming from a forms background.
Thanks.
Glen Harvy
|
|
|
|
|
Hi,
using a Gridview "id" to bind the data. For example,
GridviewID.DataSource = ObjectDataTable;
GridviewID.DataBind();
|
|
|
|
|
So, I have an ashx called image upload. Inside I have code like this:
<br />
if ( context.Session[Base.SessionKeys.CurrentRequest] != null && context.Session[Base.SessionKeys.CaseId] != null)<br />
{<br />
if (int.TryParse(context.Session[Base.SessionKeys.CurrentRequest].ToString(), out currentRequest) && int.TryParse(context.Session[Base.SessionKeys.CaseId].ToString(), out caseID))<br />
{<br />
bool success = ImageUpload.UploadImage(context.Request.Files[key], currentRequest);<br />
This all works in IE, and the first line fails in FF, and in the debugger, I see that context.Session is empty. I've looked through the context object and can find no data in it whatsoever. Is there a trick here, or does this just not work in FF ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Can i know the version of IE and firefox you are using?
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
Well, it's being tested across multiple version, but I have IE7 and the latest firefox, here.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Hello,
I am looking for a way to programatically edit the web.config file for the section below. Most importantly I will need to set the website login password to a certain value stored in the database. The password keeps changing in database whereas username remains the same. Can you please suggest a way this can be done using C# 2.0?
<authentication mode="Forms">
<forms loginurl="Login.aspx" timeout="60" protection="All">
<credentials passwordformat="Clear">
<user name="testuser" password="test123" />
</credentials>
</forms>
</authentication>
Thanks!
|
|
|
|
|
Just Check this Example
using System.Web.Configuration <br />
AuthenticationSection section =<br />
(AuthenticationSection) WebConfigurationManager.GetSection("system.web/authentication"); <br />
Label1.Text = section.Mode.ToString();
now you can able to solve your problem. for every settings of web.config there is a class on given name space. Asp.net Web Administration Tool Also used same API.
if you have any doubts ask me !!!
|
|
|
|
|
hi,
I am using the following code on Page_Load event of login page:
// Get the section.
AuthenticationSection section =
(AuthenticationSection)WebConfigurationManager.GetSection("system.web/authentication");
// Get the users collection.
FormsAuthenticationUserCollection formsAuthUserColl = section.Forms.Credentials.Users;
this.lblMsg.Text = formsAuthUserColl[0].Password;
formsAuthUserColl[0].Password. = "testuser";
The step that assigns current password to a label text works fine, however when I try to assign a password "testuser", the page fails at run-time with error "Exception Details: System.Configuration.ConfigurationErrorsException: The configuration is read only". I looked up Visual Studio 2005 documentation. It says Password property can be get or set. I have no clue why it errs out with read-only. Please advise.
Thanks.
|
|
|
|
|
Can some one tell me how to do this. Say I have created a Test website which has a default.aspx page. I have another folder called admin in the same root directory. Inside this folder i have a web page PostMessage.aspx which has a form with a Message text box and a dropdown box called visible which has only 2 values true or false. When the user clicks the Submit button I want the message in the text box to be displayed based on the visibility set on the drop down box to true or false. I actually want the message to be displayed in the default.aspx page which is in the same folder level like the Admin folder. How can I do this. I dont want to use a database for the time being.This is really urgent. Any sample code or tutorial will be great help. Thanks
Ex:
Test Website
Default.aspx
Admin Folder
PostMessage.aspx
modified on Wednesday, August 20, 2008 4:30 PM
|
|
|
|
|
1. The place where you save files here is not important.
2. You need to implement passing values between web pages.[^]
3. If you don't need to save message values in database which you write then you can leave option of database.
4. http://www.google.com
5. http://www.codeproject.com
Regards
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Hello
I use from a compress C# code in HttpCompression.cs and i use from two methods in sercice.cs
one for before compress
other for after compress
DO I do it true?
also i added HttpCompression.dll to web.config
<httpmodules>
<add name="HttpCompression">
type="Behrouz.Compression.HttpCompression, HttpCompression"/>
C# code for compress:
its file is HttpCompression.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.Services.Protocols;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.VisualBasic;
using System.IO;
using System.IO.Compression;
using Microsoft.CSharp;
/// <summary>
/// Summary description for HttpCompression
/// </summary>
namespace Behrouz.Compression
{
public class HttpCompression : IHttpModule
{
//public HttpCompression()
// {
//
// TODO: Add constructor logic here
//
// }
void IHttpModule.Dispose()
{
}
void IHttpModule.Init(System.Web.HttpApplication context)
{
context.BeginRequest += this.onZip;
}
public void onZip(object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
string encodings = app.Request.Headers.Get("Accept-Encoding");
if (encodings == null)
return;
Stream baseStream = app.Response.Filter;
encodings = encodings.ToLower();
if ((encodings.Contains("gzip")))
{
app.Response.Filter = new GZipStream(baseStream, CompressionMode.Compress);
app.Response.AddHeader("Content-Encoding", "gzip");
}
else if (encodings.Contains("deflate"))
{
app.Response.Filter = new DeflateStream(baseStream, CompressionMode.Compress);
app.Response.AddHeader("Content-Encoding", "deflate");
}
}
}
}
C# code in server side:
its file is service.cs
sing System;
using System.Web;
using System.Web.Services;
using System.Data;
using System.IO.Compression;
using System.Data.SqlClient;
using System.Web.Services.Protocols;
using Behrouz.Compression;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Diagnostics.DebuggerStepThroughAttribute(), System.ComponentModel.DesignerCategoryAttribute("code"), System.Web.Services.WebServiceBindingAttribute(Name = "Service1Soap", Namespace = "http://tempuri.org/")]
public class Service : System.Web.Services.WebService
{
public Service () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/getproducts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string HelloWorldAfterCompress() {
return "Hello World";
}
[WebMethod]
public string HelloWorldbeforeCompress()
{
return "Hello World";
}
}
|
|
|
|