|
hi jagadeeshkumar2106,
According to me there is no such possibilites of preveting user from editing Address bar. Because if you doesn't allow user to edit Address bar then how can user switch to some another website. I know you preveting user from editing your website's URL but if user wanna swtich to another website then it is not possible.
It's better to use URL Rewriting which simply hide important contents of URL and show different URL to user. So, even User edit URL it doesn't effect your application at all.
Hope this will help you.
Thanks & Regards
Dilipv
|
|
|
|
|
Hi,
i am using C# asp.net2.0
i want to know two things
1. is it possible to change the color of editing row of gridview that is when i click edit button(template) that row's color change
2. Is it possible to have some diffenrnt color of last inserted row as i have interface in above frame and i select the record and add to gridview,
Please help
Thank you
regards
imran khan
|
|
|
|
|
hi mohd imran abdul aziz,
You can directly add Back color to selected row of GridView as follows.
<asp:GridView SelectedRowStyle-BackColor ="Aqua" ID="Grid" runat="server" ></asp:GridView>
For 2nd problem you need to write code in the RowCreated Event of Gridview as follows..
protected void Grid_RowCreated(object sender, GridViewRowEventArgs e)<br />
{<br />
e.Row.BackColor = "Blue";<br />
}
Hope this will help you.
Thanks & Regards
Dilipv
|
|
|
|
|
Hi All,
When I browse my application which is already deplyed
I am getting the fallowing error.
I found this error is comming if a Number is comming in the URL, I mean when the number comes its making % internally and giving error
I am unable to find the reason behind it PLEASE HELP ME TO SOLVE THIS ERROR
Server Error in '/' Application.--------------------------------------------------------------------------------
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
THANKS, IN ADVANCE
Pashi...
prashanth,
s/w Engineer,
Integra Micro Systems.
|
|
|
|
|
Set error mode to "off " which may show the error. If it's not giving you the exception details, check server event log
|
|
|
|
|
|
i need to send the textbox value from the "second" page to "first" page..... (i.e, TEXTBOX1 of "first" page is to be get filled by TEXTBOX2 of "second" page values, while user click a button in "second" page)
I am using ASP.NET with C# (.net 2003, 1.1 framework)
Thanks in advance - john
|
|
|
|
|
use Session Variable or QueryString
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
Yes my friend.
Using querystring or session we can do it.
but what the thing is, when i click the button in "second" page, at once the textbox2 value from "second"
page is to get SET to the textbox1 of "first" page.
does we can achieve it by using query string or session.?
if so, HOW?
|
|
|
|
|
John Sundar wrote: but what the thing is, when i click the button in "second" page, at once the textbox2 value from "second"
page is to get SET to the textbox1 of "first" page.
What does it mean ?
when click on button on second page you want to back on first page ???
or both page will open ????
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
thanks for your reply Abhijit Jana.
i have two webform "parent" and "child".
in "parent" webform : one textbox(parent_textbox) and one button(parent_button).
in "child" webform : there are one textbox(child_textbox) and one button(child button).
Process flow:
when user click the "parent_button", the "child" webform should open.
Then user will input some text in "child_textbox" and when user press "child_button", the "child" webform should close and the "child_textbox" value should set to the "parent_textbox".
How can i achieve it?
EXAMPLE : in GMAIL, to attach a file, when user clicks the attach button, it open the browse window. when user select the file, the browse window will close and the corresponding path will set to the textbox.
-JOHN
|
|
|
|
|
thanks for your reply Abhijit Jana.
i have two webform "parent" and "child".
in "parent" webform : one textbox(parent_textbox) and one button(parent_button).
in "child" webform : there are one textbox(child_textbox) and one button(child button).
Process flow:
when user click the "parent_button", the "child" webform should open.
Then user will input some text in "child_textbox" and when user press "child_button", the "child" webform should close and the "child_textbox" value should set to the "parent_textbox".
How can i achieve it?
EXAMPLE : in GMAIL, to attach a file, when user clicks the attach button, it open the browse window. when user select the file, the browse window will close and the corresponding path will set to the textbox.
-JOHN.....
|
|
|
|
|
John Sundar wrote: URGENT! - Passing value from one page to another?
Mmmm.. Read this[^]. You will get the solutions. Also buy some books to learn how ASP.NET works
|
|
|
|
|
Please don't ask the same question day after day. If you don't understand the answers you got, ask again ( that is, ask the person who answered you, on the same thread, not a new one ). If you still can't work it out, then realise that the problem is with you - buy a book, do a course, bring yourself to a level of being able to understand the answers.
Like I said the other day, the easiest way is to make both pages controls on the one page, and let viewstate store the values and your main page pass them between the controls as they are shown and hidden.
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 )
|
|
|
|
|
I know you don't care about the 1 voters, but I hate seeing a decent response in grey.. voted 5 to even the score!
|
|
|
|
|
When I click a link, a grid should be visible. Its similar to tab controls but in tab controls the tabs will be horizontal, but I need it to be vertical. Like a tree view, when I click, Link1, underneath, a control will pop up which will have a grid. When I click Link2, another control should open up.
Can you suggest me which control I can use for this? I have tried to describe but if not clear, I can try explaining again.
Thanks
|
|
|
|
|
There's no control for this, but you can just show/hide your grids when the links are clicked.
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 )
|
|
|
|
|
Hi!
what's the difference between using a static class (or class with singleton pattern) and holding non-static instance in Session.
my question is mostly about application performance and resource usability, but besides that is there any other difference? creation time, dispose time?!
thanks for any help!
Seishin
life is study!!!
|
|
|
|
|
There is a big difference that you have to consider first of all, and that is that the session variable is user specific, but a static variable is not.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi there,
I have been looking into implementing Asynchronous programming model within my webservice and my asp.net web form. I have found a few good MSDN articles, [^], to achieve this but there is one thing I do not quite follow. My webservice code is as listed below.
I add all the relevant code including a web reference to my HelloWorldWebService in my asp.net web form to utilise PageAsyncTask functionality. One thing I have noticed is that when I create an instance of the HelloWorldWebService web service, it does not display the BeginHelloWorldProcedure and EndHelloWorldProcedure methods and the only asynchronous method HelloWorldProcedureAsync is displayed
My questions are:
1) why am not seeing BeginHelloWorldProcedure and EndHelloWorldProcedure methods ?
2)If I am supposed to use HelloWorldProcedureAsync method how does this supply the IAsyncResult which is the output of BeginEventHandlder part of the input of PageAsyncTask
Any help will be appreciated.
thanks.
<br />
[WebService]<br />
public class HelloWorldWebService : System.Web.Services.WebService<br />
{<br />
public delegate string HelloWorldAsyncStub();<br />
<br />
<br />
public string HelloWorldProcedure()<br />
{<br />
return "HelloWorld";<br />
}<br />
<br />
public class MyState<br />
{<br />
public object previousState;<br />
public HelloWorldAsyncStub helloworldStubStub;<br />
}<br />
<br />
[System.Web.Services.WebMethod]<br />
public IAsyncResult BeginHelloWorldProcedure(AsyncCallback cb, object s)<br />
{<br />
HelloWorldAsyncStub stub = new HelloWorldAsyncStub(HelloWorldProcedure);<br />
<br />
MyState ms = new MyState();<br />
ms.previousState = s;<br />
ms.helloworldStubStub = stub;<br />
return stub.BeginInvoke(cb, ms);<br />
}<br />
<br />
[System.Web.Services.WebMethod]<br />
public string EndHelloWorldProcedure(IAsyncResult call)<br />
{<br />
MyState ms = (MyState)call.AsyncState;<br />
return ms.helloworldStubStub.EndInvoke(call);<br />
}<br />
}<br />
|
|
|
|
|
Hi Ekynox,
ekynox wrote: 1) why am not seeing BeginHelloWorldProcedure and EndHelloWorldProcedure methods ?
I used the above code created a WebSevice in VB (as Language does not matter). And I am able to see the Begin and End of the Web method in my website where I implemented.
Could you please tell me how you implemented it in your application?
|
|
|
|
|
Hi there,
Thanks for the response. I actually worked out why I was not seeing the BeginXXX/EndXXX methods. When I complied the code under VS 2005, the compiler will automatically generate the BeginXXX/EndXXX methods of each web method found in your webservice. However, if you use VS 2008 .NET3.5 based web service the BeginXXX/EndXXX methods for each web method is not generated even if you explicitly state your BeginXXX/EndXXX methods it still wont be shown under VS 2008 .NET3.5.
It would be interesting to findout why under VS 2008 and .NET 3.5 does this happen.
In order to work around this I have decided not to bother with PageAsyncTask and just use the Async version of my web method.
cheers
|
|
|
|
|
I have searched, with no success, for the answer to my problem. I want to dynamically create a linkbutton and programatically set the command to fire when the button is clicked. I can create the button, but the only event that seems to fire is the Page_Load. A simple example is below:
---- File: Test1.aspx ----
<code>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="ReportCard.Test1" %>
<!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>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</div>
</form>
</body>
</html>
</code>
---- File: Test1.aspx.cs ----
<code>
using System;
using System.Data;
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;
using NLog;
using System.Text;
namespace ReportCard
{
public partial class Test1 : System.Web.UI.Page
{
public static Logger logger = LogManager.GetCurrentClassLogger();
protected void Page_Load(object sender, EventArgs e)
{
logger.Info("Page_Load: Postback: {0}", Page.IsPostBack.ToString());
}
protected void Button1_Click(object sender, EventArgs e)
{
logger.Info("Button1_Click");
Table table = new Table();
int i = 1;
TableRow tr = new TableRow();
TableCell tdSysCode = new TableCell();
tdSysCode.CssClass = "tdSysCode";
tdSysCode.Text = string.Format("{0:000}", i);
TableCell tdSysname = new TableCell();
tdSysname.CssClass = "tdSysname";
LinkButton lb = new LinkButton();
lb.CommandName = "lbViewSystem_Click";
lb.CommandArgument = i.ToString();
lb.Command += new CommandEventHandler(lbViewSystem_Click);
lb.Text = string.Format("System {0:000}", i);
tdSysname.Controls.Add(lb);
tr.Cells.Add(tdSysCode);
tr.Cells.Add(tdSysname);
table.Rows.Add(tr);
table.ID = "tblSystemResults";
table.CellPadding = 0;
table.CellSpacing = 0;
TableHeaderRow thrHeader = new TableHeaderRow();
TableHeaderCell thSystemCode = new TableHeaderCell();
thSystemCode.Text = "System Code";
TableHeaderCell thSystemName = new TableHeaderCell();
thSystemName.Text = "SystemName";
thrHeader.Cells.Add(thSystemCode);
thrHeader.Cells.Add(thSystemName);
table.Rows.AddAt(0, thrHeader);
PlaceHolder1.Controls.Add(table);
}
protected void lbViewSystem_Click(object sender, CommandEventArgs e)
{
logger.Info("lbViewSystem_Click");
Literal1.Text = string.Format("Argument = {0} at {1}", e.CommandArgument, DateTime.Now.ToString("MM.dd.yyyy HHmmss"));
}
}
}
</code>
On initial load, click the button, display the link button, then click the link button. You should see a message, but nothing happens.
I've read about creating the link button in the page_load (or on_init) method, but haven't had any success with that either.
Any tips are appreciated.
--G
|
|
|
|
|
Any dynamically created button must be created before page load ( usually in loadviewstate, before viewstate is loaded ) in order for it's events to fire, because the button has to exist when viewstate is restored, in order for it's events to hook up properly.
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 )
|
|
|
|
|
Christian,
I must be really dense here -- I've tried overriding the OnInit and/or the LoadViewState, and recreating the object in every Page_Load, but still no success.
Currently, I have a member variable, LinkButton lb. I have a method, CreateButton, that creates the button, sets the properties, and creates the CommandEventHandler. I call this method in various places, but no luck. What am I missing?
<br />
protected LinkButton lb = null;<br />
protected override void LoadViewState(object savedState)<br />
{<br />
CreateButton();<br />
base.LoadViewState(savedState);<br />
}<br />
<br />
protected void CreateButton()<br />
{<br />
if (null == lb)<br />
{<br />
lb = new LinkButton();<br />
}<br />
lb.ID = "lbTest001";<br />
lb.CommandName = "lbViewSystem_Click";<br />
lb.CommandArgument = "1";<br />
lb.Command += new CommandEventHandler(lbViewSystem_Click);<br />
lb.Text = string.Format("System {0:000}", 1);<br />
}<br />
<br />
protected void lbViewSystem_Click(object sender, CommandEventArgs e)<br />
{<br />
logger.Info("lbViewSystem_Click");<br />
Literal1.Text = string.Format("Argument = {0} at {1}", e.CommandArgument, DateTime.Now.ToString("MM.dd.yyyy HHmmss"));<br />
}<br />
Again, any help is very much appreciated.
--G
|
|
|
|