نمایش نتایج 1 تا 14 از 14

نام تاپیک: استفاده از event های سمت سرور در کنترل های html ای

  1. #1
    کاربر دائمی آواتار shirin_sh1024
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    تهران
    پست
    136

    استفاده از event های سمت سرور در کنترل های html ای

    سلام
    در کنترل های سرور ساید برای اینکه بخوایم با کلیک شدن روی اون کنترل مثلا به صفحه دیگه ای کاربر هدایت بشه روی اون کنترل کلیک میکنیم و event مربوط به اون در سمت سرور ساخته میشه و با دستور response.redirect کاربر رو به صفحه ای که میخوایم میفرستیم
    اگه بخوایم همین کار رو برای کنترل های html ای انجام بدیم باید چطوری انجامش داد؟
    در واقع من یه img دارم که با جی کوئری روش افکت گذاشتم حالا میخوام وقتی روش کلیک میشه کاربر به صفحه دیگه ای بره بهترین روش واسه انجام این کار چیه؟

  2. #2

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    <img onclick="window.location='YourPage.aspx'" src=""/>

  3. #3
    کاربر دائمی آواتار shirin_sh1024
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    تهران
    پست
    136

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    ممنون آقا پیمان مشکلم حل شد
    فقط یه سئوال ، اصلا امکانش هست بشه به event های این کنترل ها مثله کنترل های سرور سایت در code behind دسترسی داشت و اونجا در event ها کد نوشت؟ مثلا اگه runat سرور بشند میشه باهاشون مثله یه کنترل سرور ساید رفتار کرد؟(و اگه میشه چطوری؟) یا فقط میشه از جاوا اسکریپت استفاده کرد؟

  4. #4

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    مثلا اگه runat سرور بشند میشه باهاشون مثله یه کنترل سرور ساید رفتار کرد؟(و اگه میشه چطوری؟)
    <img  runat=server id="img"/>


     protected void Page_Load(object sender, EventArgs e)
    {
    img.Src = "~/image/1.jpg";
    }

  5. #5
    کاربر دائمی آواتار shirin_sh1024
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    تهران
    پست
    136

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    درسته ولی در کدی که نوشتید src پروپرتی هست که الان در event ، page load صفحه بهش مقدار دادید . سئوال من در مورد event هاست اینکه میشه در code behind متدی مثله متد کلیک کنترل ها برای کنترل های html ای در سمت سرور داشت؟
    یه چیزی شبیه به این:

     

    protected void Button1_Click(object sender, EventArgs e)
    {
    }


    این متد کلیک برای یک botton هستش ولی من میخوام همچین متدی برای مثال برای یک input یا img داشته باشم

  6. #6

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    <img  runat=server id="img"/>


    protected void Page_Load(object sender, EventArgs e)
    {
    img.Attributes.Add("onclick", "window.location='YourPage.aspx'");
    }

  7. #7
    کاربر تازه وارد آواتار hosseinrahmatei
    تاریخ عضویت
    مرداد 1387
    محل زندگی
    تهران
    پست
    84

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    دوست عزیز کنترل های html اگر ranut برابر با Server باشد مثل کنترل های دکمه ، تکس باکس و... دارای دو رویداد سمت سرور می باشند که
    1- server click
    2- server change
    که می توان کد مربوطه را در ان قرار داد

  8. #8
    کاربر دائمی آواتار shirin_sh1024
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    تهران
    پست
    136

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    دوست عزیز کنترل های html اگر ranut برابر با Server باشد مثل کنترل های دکمه ، تکس باکس و... دارای دو رویداد سمت سرور می باشند که
    1- server click
    2- server change
    که می توان کد مربوطه را در ان قرار داد
    یه کم بیشتر توضیح میدید؟ این دو تا رویدادی که فرمودین رو از کجا باید بیارم؟
    در code behind باید دستی بنویسم؟

  9. #9
    کاربر تازه وارد آواتار hosseinrahmatei
    تاریخ عضویت
    مرداد 1387
    محل زندگی
    تهران
    پست
    84

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    نقل قول نوشته شده توسط shirin_sh1024 مشاهده تاپیک
    یه کم بیشتر توضیح میدید؟ این دو تا رویدادی که فرمودین رو از کجا باید بیارم؟
    در code behind باید دستی بنویسم؟
    دوست عزیز شما به طور مثال وقتی یک دکمه html را ranut را برابر server قرار دادید به بخش design رفته و روی دکمه مورد نظر دوبار کلیک کنید خودش رویداد مربوطه را می اورد
    یا در بخش کد بیهایند بروید و کنترل مورد نظر را انتخاب و سپس رویدادهای ان را میتوانید مشاهده کنید

  10. #10
    منتظر تایید آدرس ایمیل
    تاریخ عضویت
    خرداد 1389
    محل زندگی
    تهران
    سن
    35
    پست
    148

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    نقل قول نوشته شده توسط Peyman.Gh مشاهده تاپیک
    <img onclick="window.location='YourPage.aspx'" src=""/>
    درست کار میکنه، فقط چرا کرسر موس شبیه دست نمیشه؟!
    یعنی مشخص نیست که روی لینک هستیم.

  11. #11
    کاربر دائمی آواتار shirin_sh1024
    تاریخ عضویت
    خرداد 1387
    محل زندگی
    تهران
    پست
    136

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    چرا کرسر موس شبیه دست نمیشه؟!
    فکر کنم با جی کوئری بشه درستش کرد
    یادمه یه جا همچین چیزی رو تو جی کوئری دیدم که وقی موس بره رو یه کنترلی بتونی تعیین کنی موس به چه شکلی دربیاد

  12. #12

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    باید یک کلاس به این img بدهید و درحالت hover تعیین کنید که کرسر موس عوض شود.
    <img onclick="window.location='YourPage.aspx'" src=""/ class="imgclass">


    .imgclass:hover{cursor:pointer}

  13. #13

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    فکر کنم با جی کوئری بشه درستش کرد
    نیازی به Jquery نمیباشد.
     <img onclick="window.location='YourPage.aspx'" src="" style="cursor:pointer;"/>

  14. #14
    کاربر دائمی آواتار BahmanDB
    تاریخ عضویت
    اردیبهشت 1388
    محل زندگی
    شهر اولین ها
    پست
    273

    نقل قول: استفاده از event های سمت سرور در کنترل های html ای

    کپی شده از MSDN




    1. DHTML Events
    2. This section contains the events exposed by the Dynamic HTML (DHTML) Object Model.
    3. Events
    4. onabort Fires when the user aborts the download.
      onactivate Fires when the object is set as the active element.
      onafterprint Fires on the object immediately after its associated document prints or previews for printing.
      onafterupdate Fires on a databound object after successfully updating the associated data in the data source object.
      onbeforeactivate Fires immediately before the object is set as the active element.
      onbeforecopy Fires on the source object before the selection is copied to the system clipboard.
      onbeforecut Fires on the source object before the selection is deleted from the document.
      onbeforedeactivate Fires immediately before the activeElement is changed from the current object to another object in the parent document.
      onbeforeeditfocus Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected.
      onbeforepaste Fires on the target object before the selection is pasted from the system clipboard to the document.
      onbeforeprint Fires on the object before its associated document prints or previews for printing.
      onbeforeunload Fires prior to a page being unloaded.
      onbeforeupdate Fires on a databound object before updating the associated data in the data source object.
      onblur Fires when the object loses the input focus.
      onbounce Fires when the behavior property of the marquee object is set to "alternate" and the contents of the marquee reach one side of the window.
      oncellchange Fires when data changes in the data provider.
      onchange Fires when the contents of the object or selection have changed.
      onclick Fires when the user clicks the left mouse button on the object.
      oncontextmenu Fires when the user clicks the right mouse button in the client area, opening the context menu.
      oncontrolselect Fires when the user is about to make a control selection of the object.
      oncopy Fires on the source element when the user copies the object or selection, adding it to the system clipboard.
      oncut Fires on the source element when the object or selection is removed from the document and added to the system clipboard.
      ondataavailable Fires periodically as data arrives from data source objects that asynchronously transmit their data.
      ondatasetchanged Fires when the data set exposed by a data source object changes.
      ondatasetcomplete Fires to indicate that all data is available from the data source object.
      ondblclick Fires when the user double-clicks the object.
      ondeactivate Fires when the activeElement is changed from the current object to another object in the parent document.
      ondrag Fires on the source object continuously during a drag operation.
      ondragend Fires on the source object when the user releases the mouse at the close of a drag operation.
      ondragenter Fires on the target element when the user drags the object to a valid drop target.
      ondragleave Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.
      ondragover Fires on the target element continuously while the user drags the object over a valid drop target.
      ondragstart Fires on the source object when the user starts to drag a text selection or selected object.
      ondrop Fires on the target object when the mouse button is released during a drag-and-drop operation.
      onerror Raised when there is an error that prevents the completion of the cross-domain request.
      onerror Fires when an error occurs during object loading.
      onerrorupdate Fires on a databound object when an error occurs while updating the associated data in the data source object.
      onfilterchange Fires when a visual filter changes state or completes a transition.
      onfinish Fires when marquee looping is complete.
      onfocus Fires when the object receives focus.
      onfocusin Fires for an element just prior to setting focus on that element.
      onfocusout Fires for the current element with focus immediately after moving focus to another element.
      onhashchange Raised when there are changes to the portion of a URL that follows the number sign (#).
      onhelp Fires when the user presses the F1 key while the browser is the active window.
      onkeydown Fires when the user presses a key.
      onkeypress Fires when the user presses an alphanumeric key.
      onkeyup Fires when the user releases a key.
      onlayoutcomplete Fires when the print or print preview layout process finishes filling the current LayoutRect object with content from the source document.
      onload Raised when the object has been completely received from the server.
      onload Fires immediately after the browser loads the object.
      onlosecapture Fires when the object loses the mouse capture.
      onmessage Fires when the user sends a cross-document message with postMessage.
      onmousedown Fires when the user clicks the object with either mouse button.
      onmouseenter Fires when the user moves the mouse pointer into the object.
      onmouseleave Fires when the user moves the mouse pointer outside the boundaries of the object.
      onmousemove Fires when the user moves the mouse over the object.
      onmouseout Fires when the user moves the mouse pointer outside the boundaries of the object.
      onmouseover Fires when the user moves the mouse pointer into the object.
      onmouseup Fires when the user releases a mouse button while the mouse is over the object.
      onmousewheel Fires when the wheel button is rotated.
      onmove Fires when the object moves.
      onmoveend Fires when the object stops moving.
      onmovestart Fires when the object starts to move.
      onoffline Raised when Windows Internet Explorer is working offline.
      ononline Raised when Internet Explorer is working online.
      onpage Not implemented.
      onpaste Fires on the target object when the user pastes data, transferring the data from the system clipboard to the document.
      onprogress Raised when the browser starts receiving data from the server.
      onpropertychange Fires when a property changes on the object.
      onreadystatechange Sets or retrieves the event handler for asynchronous requests.
      onreadystatechange Fires when the state of the object has changed.
      onreset Fires when the user resets a form.
      onresize Fires when the size of the object is about to change.
      onresizeend Fires when the user finishes changing the dimensions of the object in a control selection.
      onresizestart Fires when the user begins to change the dimensions of the object in a control selection.
      onrowenter Fires to indicate that the current row has changed in the data source and new data values are available on the object.
      onrowexit Fires just before the data source control changes the current row in the object.
      onrowsdelete Fires when rows are about to be deleted from the recordset.
      onrowsinserted Fires just after new rows are inserted in the current recordset.
      onscroll Fires when the user repositions the scroll box in the scroll bar on the object.
      onselect Fires when the current selection changes.
      onselectionchange Fires when the selection state of a document changes.
      onselectstart Fires when the object is being selected.
      onstart Fires at the beginning of every loop of the marquee object.
      onstop Fires when the user clicks the Stop button or leaves the Web page.

      1. onstorage

      Fires when a DOM Storage area is updated.
      onstoragecommit Fires when a local DOM Storage area is written to disk.
      onsubmit Fires when a FORM is about to be submitted.
      ontimeout Raised when there is an error that prevents the completion of the request.
      onunload Fires immediately before the object is unloaded.

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •