|
I would avoid using javascript for a security method.
As mentioned before a user can simply turn it off in their browser by-passing your security
We are not a Code Charity
|
|
|
|
|
One thing you can do is redirect all links through location.replace() of JavaScript so that there would be no history and hence back button can be voided to some extent.
You can also try using the history.forward() trick.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
Hi all,
Can anyone tell which one load faster then other GridView, DataList, Repeater, DetailsView, FormView.
Or can you give me a suggestion that which one will works better compare to other controls.
Thanks in Advance
Regards,
Senthil.S
Senthil.S
Software Engineer
|
|
|
|
|
The reason they all exist, is that different situations call for different tools. If one was best, why would MS not just release that one ?
Christian Graus
Please read this if you don't understand the answer I've given you
"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 response. The real situation of main is, i have to create a user control to load the datas from database and the control should be faster.
So i need a control to load the data faster and it should good also.
Thank you
Regards
Senthil.S
Senthil.S
Software Engineer
|
|
|
|
|
Either use a repeater or create your own control. Creating custom controls and binding using a DataReader is fast.
|
|
|
|
|
i am doing it thru javascript..this is the statement..
document.getElementById('ctl00_ContentPlaceHolder1_lstRole').setInputValue=retVal.roleID;
--retVal.roleID //value i need to be selected in list box
--document.getElementById('ctl00_ContentPlaceHolder1_lstRole').setInputValue //list box
the same thing is wrkin for drop down and text boxes but not for list box. can any1 tell me whats wrong in this?
|
|
|
|
|
Hi
I am creating a chat application using ajax asp .net 2.0, here whenever the user enter the text message and hit enter, i have to pass this message to server in ajax, i am doing it right now using the following code
url = 'Chat.aspx?action=chatmsg&u=' + userid +'&msg='+ txtMsg;
req = getAjax();
req.onreadystatechange = function(){
if( req.readyState == 4 && req.status == 200 ) {
updateAll();
}
}
req.open( 'GET', url, true );
req.send( null );
but the problem is some time the txtmsg (user entered message would be in html code). how to pass html formatted message to server using ajax.
Please help
Thanks
SRini
|
|
|
|
|
Are you getting any error ?
Probably tage <> not allowed to send as message. However you can do one thing replace these tag with any special character on client side and then again parse it on server side.
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Actually, there is a standard format for this already.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Ok, Thanks Christian G
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
yeah if we appened the formatted html message with quering string, it is not even get called when httprequest.send is happened.
Thanks
SRini
|
|
|
|
|
By html encoding it first. For example, a space becomes %20.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 for the reply,
is there any built-in funtion to format the html messges or do we need to need manually parse all tags and convert it to a normal string?
Thanks
SRini
|
|
|
|
|
not sure in js. I would expect you'd find one on the web, I doubt one is built in.
Christian Graus
Please read this if you don't understand the answer I've given you
"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 )
|
|
|
|
|
Ok i got this function from web and it worked
var encodedHtml = escape(NewsBody_rich.document.body.innerHTML);
encodedHtml = encodedHtml.replace(/\
encodedHtml = encodedHtml.replace(/\?/g,"%3F");
encodedHtml = encodedHtml.replace(/=/g,"%3D");
encodedHtml = encodedHtml.replace(/&/g,"%26");
encodedHtml = encodedHtml.replace(/@/g,"%40");
I was thinking about another way to pass the data to server using hidden textbox
I thought of putting the formatted html message to a asp hidden textbox and take it in the code-behind using the following script
document.getElementById("TextBox1").value=NewsBody_rich.document.body.innerHTML;
but this not working, when i put alert after this script code it shows the TextBox1.Value as assigned html message, but when i debug in the code-behind the TextBox1.Text value is empty. i dont know why?! i did lot of debugging still couldnt able to find, i even replace asp server textbox with html server texbox, still not working!!
Do you have any idea why is it so!?
Thanks
SRini
|
|
|
|
|
Recently I've been looking at the release of the extensibility framework and the new addin namespace in .Net 3.5. This has me wanting to play around with my own extensions for web apps.
I know DNN has modules. I'm trying to wrap my head around how to implement my own extensions in my applications. Can I use an existing framework? How would I go about this.
I'm sure I'm not asking the right questions. I've done some searching and cannot find any answers. Please help.
Darroll
|
|
|
|
|
Hi
I have a problem when trying to run SiteSearch on server. Locally works fine.
Please help.
jovan.zubovic@iag.com.au
|
|
|
|
|
This is not a enough description to direct your problem. Please describe again in proper way what you did.
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
What technology have you used for your site seacrh?
We are not a Code Charity
|
|
|
|
|
Hello Everybody
I knoe how to show the total price on my gridViw footer, but I want to put a discount inside my grid view footer, like
GridView Footer
SubTotal = £100.00 ( adding all items price automatically)
Discount (%) = 10 ( user need to put a discount % )
Total = £90.00 ( SubTotal - Discount
I want to put a textBox on Gridview Footer and underneith GridView I want to put a button called Update
When you click btnUpdate then it will check discount percentage like
IF NOT txtDiscount.test = "" THEN
Total = SubTotal - Discount
ELSE
Total = SubTotal
END IF
How can I do it?
If you any example or guideline please tell me
waiting for your valuable instructions
Sarfarj Ahmed
|
|
|
|
|
Are you not able to add controls in footer as given below way:
<FooterTemplate>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<asp:Button ID="Button1" CommandName = "ADD" runat="server"
Text="Add" />
</FooterTemplate>
And trap the button click event on GridView1_RowCommand, perform as per you requirement.
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
I'm using a 3rd-party component for a shopping cart (dotnetCART), and I am having a problem formatting a string. I know that since this is a 3rd-party control, you all may not be able to help, but I thought I's ask anyways...
The dotnetCART component has a web control called "Display Catalog" which displays products from the database. Although fields such as "Price" and "Weight" are included in the web control, my "WholePrice" field is not, and so I have to pull it in using the "GetCustom" property (or is it called a method?).
Right now the code in question looks like this:
<br />
< dotnetCART:DisplayCatalog ><br />
<br />
...some code...<br />
<br />
< ItemDetailsTemplate><br />
< asp:Label <br />
ID="lblWholesalePrice" <br />
runat="server"<br />
Text='<%#Container.GetCustom("WholePrice") %>'><br />
< /asp:Label><br />
< /ItemDetailsTemplate><br />
< /dotnetCART:DisplayCatalog><br />
(FYI, a non-custom field would have been written into the label as "<%#Container.Price%>")
The above label works OK, but it displays the data without formatting, and so my "WholePrice" appears as "12.55" or "6.554", not "$6.55". I've read the asp.net information on formatting strings, and I have tried to apply a similar formatting syntax to the "Container.GetCustom" without success. I have tried:
<br />
Text='<%#Container.GetCustom(FormatCurrency("WholePrice")) %>'>
...returns an error from the component: "Conversion from string "WholePrice" to type 'Double' is not valid."
Text='<%#Container.GetCustom("WholePrice","{0:c}") %>'
...returns "BC30057: Too many arguments to 'Public Function GetCustom(strField As String) As String'."
Text='<%# DataBinder.Eval(Container.GetCustom, "WholePrice", "{0:c}")%> '>
...returns "BC30455: Argument not specified for parameter 'strField' of 'Public Function GetCustom(strField As String) As String'."
and
Text='<%# String.Format("{0:c}", Container.GetCustom("WholePrice")) %>'
... does not have any effect, but displays the unformatted "WholePrice".
Once again, I realize no one may be able to help in this case, but thank you for any advice or suggestions. The 3rd-party documentation seems a little fuzzy on this subject to my novice eyes, but the relevant passages appear to be as follows:
<quote>
Catalog Template Properties / Containers:
GetCustom("FieldName"): Used to show custom field data in the Templates. This returns any custom field data.
Programmatically changing a control value within a given page:
This is useful if you wish to change a control within the template programmatically, for example for language customization.
Label myTemp = (Label) Page.FindControl("Catalog:ItemDetails:myWeight");
if(myTemp != null);
myTemp.Text="Weight(Test):";
The "Catalog:ItemDetails:myWeight" is the ID for Weight label control used in default.aspx. The "Catalog" is the ID control in default.aspx page for Catalog control and "ItemDetails" is hardcoded ID inside the component for ItemDetailsTemplate Template. "myWeight" is the ID for label inside the ItemDetailsTemplate Template in default.aspx page
Thanks again.
EDIT: I just got some help with this.
Text='<%#FormatCurrency(Container.GetCustom("WholePrice")) %> does the trick.
modified on Tuesday, June 10, 2008 3:28 PM
|
|
|
|
|
Can you try it formate in OnRowDataBound event ?
Parwej Ahamad
R & D with IIS 5.0/6.0
|
|
|
|
|
Hi
I have a webpage and webservice on localhost in different project. In different virtual directories. I want to call webservice function as follows and alert it onComplete.
---------------------------
function Button1_onclick() {
ret = SimpleWebServices.SimpleService.SayHello(document.getElementById('Text1').value, OnComplete, OnTimeOut, OnError);
return(true);
}
function OnComplete(arg) {
alert(arg);
}
-------------
Webservice code is very simple..
namespace SimpleWebServices
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService()]
public class SimpleService : System.Web.Services.WebService
{
[WebMethod]
public string SayHello(String Name)
{
return "Hello : " + Name;
}
}
}
-----------------
But, i get error : "SimpleWebServices is not defined"
Not sure what I am missing. Please advise. Thanks
Pankaj
|
|
|
|