|
Set ValidateRequest="false" in page directive. But it is not advisable.
|
|
|
|
|
Code of WebForm1.aspx.cs as below:
Q: when i submit the aspx page to server,I want to get Method,filed and event in *.aspx.cs description by FQAAttribute .
E.G.: I want to get event Page_Load,Button1_Click,Button2_Click,Button3_Click,
because those description by [FQA("M1")],[FQA("M1","F001")],[FQA("M1","F002")].
How to do ? Thanks.
------------------------------------------------
CODE:
namespace WebIhttpModule
{
/// <summary>
/// WebForm1
/// </summary>
///
[FQA("WebFrom1.M1")]
public class WebForm1 : System.Web.UI.Page
{
#region Web Form Code
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.Button Button2;
protected System.Web.UI.WebControls.Button Button3;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Button Button4;
protected System.Web.UI.WebControls.TextBox TextBox3;
override protected void OnInit(EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Button2.Click += new System.EventHandler(this.Button2_Click);
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.Button4.Click += new System.EventHandler(this.Button4_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
[FQA("M1")]
private void Page_Load(object sender, System.EventArgs e)
{
}
[FQA("M1","F001")]
private void Button1_Click(object sender, System.EventArgs e)
{
this.TextBox1.Text= Button1.Text;
}
[FQA("M1","F002")]
private void Button2_Click(object sender, System.EventArgs e)
{
this.TextBox2.Text= Button2.Text;
}
[FQA("M1","F003")]
private void Button3_Click(object sender, System.EventArgs e)
{
this.TextBox3.Text= Button3.Text;
}
private void Button4_Click(object sender, System.EventArgs e)
{
}
}
}
---------------------------------------------
/// <summary>
/// FQA Attribute
/// </summary>
[AttributeUsage(AttributeTargets.Method |
AttributeTargets.Class |
AttributeTargets.Property |
AttributeTargets.Event |
AttributeTargets.Interface |
AttributeTargets.Delegate, AllowMultiple= true) ]
public class FQAAttribute : System.Attribute
{
private string _codemod = "";
private string _codefun = "";
/// <summary>
/// set the FQA right by module
/// </summary>
/// <param name="strFunctionCode">module code</param>
public FQAAttribute(string strModCode)
{
_codemod = strModCode.Trim();
}
/// <summary>
/// set the FQA right by module and function
/// </summary>
/// <param name="strModCode">module code</param>
/// <param name="strFunctionCode">function code</param>
public FQAAttribute(string strModCode, string strFunctionCode)
{
_codemod = strModCode.Trim();
_codefun = strFunctionCode.Trim();
}
}
|
|
|
|
|
Who can help ...,please...
|
|
|
|
|
|
Your code is very ugly and badly put together. Did you have a question ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
you should clarify what you want, not delete your post. You needed a LOT of help with the code that was posted, why not ask, and get the help you need ? For a start, using strings for different settings is bad, use an enum. The rest was messy, but that's the only specific thing I remember.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Uma J wrote: if (Mode = "A")
{
Uma J wrote: if (Mode = "C")
{
Uma J wrote: if (Mode = "B")
{
Do you need to compare something or you need to assign something indeed.
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
Use the following code to get all printers. Thus the dropdownlist contains list of installed printers. If am saving Microsoft XPS Document Writer as my printer and try to print using the printer a window is opened for saving the print document.But when I host the application and try to print with Microsoft XPS Document Writer the page shows a javascript error or the page become struct.I think it is because if am selecting Microsoft XPS Document Writer as printer its not a valid printer and shows the dialog window to save the document but after hosting save window is opened and the timeout occurs therefore the errors occurs.If am selecting a valid printer it works fine. Can you help me to avoid Microsoft XPS Document Writer from my installed printers lisrt or help any way
//Get all the Installed printers
foreach (String strPrinterName in PrinterSettings.InstalledPrinters)
{
ddlSetPrinter.Items.Add(strPrinterName);
}
|
|
|
|
|
You asked same quesiton already 10 times.
is it so hard to put and "if" inside and check printer name equals to the one of XPS Document Writer?
You do know you can write "if", do you?
|
|
|
|
|
Apparently, he did not know that. Another example of what happens when you ship jobs to the third world. Someone is probably paying for this code.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
If you want instant answers, you need to hire someone. If you want free answers, learn to wait for them.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Whats the problem with you ? You have posted total 6 post and all are posted in Today and on same topic .
|
|
|
|
|
Is it possible to create Parent and Child Nodes dynamically through database....if yes then plz give me an example.
|
|
|
|
|
Of course it is. Your question is meaningless. An example would take a while to write, and would hardly be likely to fit your scenario ( plus, we like people who can write their own code ).
Typically, you'd store ids for each item and also store a parent id to help you position stuff in your tree.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
how can I avoid the Microsoft XPS Document Writer from installed printers list
|
|
|
|
|
Stop asking the same things over and over. Refer to the answers you were given, and grow a brain. You cannot write code to control what printers show up in the print dialog in ASP.NET, and if you're showing a list of printers in your form somewhere, how hard can it be to remove it ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Use the following code to get all printers. Thus the dropdownlist contains list of installed printers. If am saving Microsoft XPS Document Writer as my printer and try to print using the printer a window is opened for saving the print document.But when I host the application and try to print with Microsoft XPS Document Writer the page shows a javascript error or the page become struct.I think it is because if am selecting Microsoft XPS Document Writer as printer its not a valid printer and shows the dialog window to save the document but after hosting save window is opened and the timeout occurs therefore the errors occurs.If am selecting a valid printer it works fine. Can you help me to avoid Microsoft XPS Document Writer from my installed printers lisrt or help any way
//Get all the Installed printers
foreach (String strPrinterName in PrinterSettings.InstalledPrinters)
{
ddlSetPrinter.Items.Add(strPrinterName);
}
|
|
|
|
|
banerjins wrote: //Get all the Installed printers
foreach (String strPrinterName in PrinterSettings.InstalledPrinters)
{
if (!strPrinterName.Contains("XPS"))
ddlSetPrinter.Items.Add(strPrinterName);
}
I assume you're running your site on a local network, the server is part of the local network, and so the user tells the server which printer to print on to, and because it's a local network, that printer is actually present where the user is ?
That you get a javascript error is odd. How are you starting the printing process ? What are you printing exactly ? If the server send a page to be printed, I don't see how that can change the javascript.
banerjins wrote: nd shows the dialog window to save the document but after hosting save window is opened and the timeout occurs therefore the errors occurs
If a dialog is shown on the client, that's probably part of the issue. Overall what you're doing, sounds messy and ill advised.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi ,
I have created simple web application in .net 2.0 C# . I have added this code
to add a favicon. This is working fine, if I inherit my page from "System.Web.UI.Page". but it is not working if I inherit from "System.Web.UI.MobileControls.MobilePage" .Please tell me the reason and resolution for this?
|
|
|
|
|
Rename the icon file to favicon.ico and put it in the root of your site, it should work automatically then.
|
|
|
|
|
I have 1 treeView for category & subcategory. It is filling by database.
I saved all checked nodes value of treeview control in table "AvailableSubCategory"
Now, I want to make a modification in data,
So that, I want to check only that subcategory Nodes of TreeView, that are in "AvailableSubCategory" table.
How can I do this?
|
|
|
|
|
kripa ostwal wrote: So that, I want to check only that subcategory Nodes of TreeView, that are in "AvailableSubCategory" table.
How can I do this?
How is this related to ASP.Net?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
your question was not clear...
|
|
|
|
|
Sir,
I want to ckeck some childnode from TreeView, which have category(nodes of treeview) and subCategories(nodes of category nodes) information.
When user click on btnModify, I want to show all details on page from database (whatever subCategories he selected at save time)
In database I stored values of checked subCategories(at the time of Save record. For that I Used following code to get selected Nodes values
For intCnt = 0 To TreeView1.CheckedNodes.Count - 1
arrSubCat(intCnt) = (TreeView1.CheckedNodes(intCnt).Value)
Next
Then I stored that onebyone in database
At the time of modification, I retrive that subCategory values in object of datatable.
Now I want to show checkmarks for those subCategories nodes, where values will match.
For that i wrote,
If objDT.Rows.Count > 0 Then
For intCnt = 0 To objDT.Rows.Count - 1
TreeView1.FindNode(objDT.Rows(intCnt).Item
(0).ToString).Checked = True
Next
End If
But It gives error s Index Out of bound
|
|
|
|