Showing posts with label guys. Show all posts
Showing posts with label guys. Show all posts

Monday, March 26, 2012

prevent ajax functions used by Malicious users using HTTP POST

Hi Guys ,i have a problem in my site,i m having a class which is having ajax functions,problem is that Malicious users can access these ajax functions method using HTTP POST.so that he can do all the task using HTTP POST.

in config file i write following code.

<httpHandlers>

<addverb="POST,GET"path="ajax/*.ashx"type="Ajax.PageHandlerFactory,eAjax"/>

<addverb="POST,GET"path="ajaxpro/*.ashx"type="AjaxPro.AjaxHandlerFactory, AjaxPro"/>

</httpHandlers>

the malicious user use the functions using following Code.

Post

/ajax/al2006.ajaxFunctions,al2006.ashx?_deleteusers&_session=no.

so i want to prevent that problem.so pls give me any suitable solution of this.shall be thankful to all.

Thanks in Advance.

jkyadav

You can use the following line of Code in your Generic handler to check if the User is Authenticated:

if (HttpContext.Current.User.Identity.IsAuthenticated)
{
//Do what you need to do for authenticated users
}

prevent repeat animation (animationextender)

Hey guys. I have a textbox which will expand when I click it. However, once expanded it's still obviously active and it will replay the animation when I click it again. How can I make the textbox expand (like the example below) when clicked, but then disable further animations of it? I obviously cant disable the textbox. I was thinking a conditionanimation would work but Im not that great with javascript.
<ajaxToolkit:AnimationExtender id="Ani" runat="server" TargetControlID="TextBox1"> <Animations> <OnClick> <Resize width="400px" duration="0.3" fps="10" /> </OnClick> </Animations></ajaxToolkit:AnimationExtender><asp:TextBox ID="TextBox1" Width="200px" TextMode="MultiLine" Rows="6" runat="server" />
Thanks /J

Hi,

Yeah , a conditional animation would be the way to go about this .

Try this Mark-Up ..

<

scriptlanguage="javascript">var expandCount = 1;var expandMaxCount = 1;

function ShouldIExpand()

{

var shouldExpand =false;

if ( expandCount <= expandMaxCount )

shouldExpand =

true;

expandCount++;

return shouldExpand ;

}

</script>

<OnClick>

<ConditionConditionScript="ShouldIExpand()">

<Resize width="400px" duration="0.3" fps="10" /></Condition> </OnClick>

Hope this helps.

If it resolves the issue , please mark my reply as the answer


exactly what i had in mind, it works! ThanksYes

Wednesday, March 21, 2012

problem in implement ajax component

hi guys,

i m shaikhu. i try to implement ajax components . i start from ajax drag panel , i make it and it's working but when i drag and place panel in my page it go again it' default position not stay anywhere in my page .

what's fault.

Hi,

the DragPanel uses the BODY area as the drop zone. This area is determined by the layout of the page, but you can enlarge it using CSS:

body { height:600px;}

problem in returning DataTable

Hello Guys,

i am calling a ajax call to page method which returns DataTable. but i got following error

"The server method 'GetInfo" failed with the following error: System.InvalidOperationException-- A circular reference was detected while serializing an object of type 'System.Reflection.Module' "

does ajax support serializing datatable?

Thanks,

Kiran

Hi,kalvagadda

The Latest version of Ajax Does not have the support of DataTable and DataSet.

You can check these links for answer and more info:

http://forums.asp.net/t/1121145.aspx

http://forums.asp.net/t/1119899.aspx

http://forums.asp.net/t/1122022.aspx

http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx

Let me know if you need more info.

Hope this helps.

Thanks!


Hi,

Thanks for the reply. Links were helpful.

Thanks,

Kiran


ThanksJin-Yu Yin - MSFTfor providing more info