Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RegisterStartup Script

Empfohlene Antworten

Veröffentlicht

Heyho,

ich erhalte derzeit diesen Fehler:


'System.Web.UI.Page.RegisterStartupScript(string, string)' is obsolete: 'The recommended alternative is ClientScript.RegisterStartupScript(Type type, string key, string script). http://go.microsoft.com/fwlink/?linkid=14202'

bei folgendem Code:

        protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)

        {

            try

            {

                  //......

            }

            catch

            {

                Page.RegisterStartupScript("", "<script>alert('Test')</script>");

            }

        }

Wenn ich das jetzt allerdings umschreiben will zu

               ClientScript.RegisterStartupScript("", "<script>alert('Test')</script>");

erhalte ich diesen Fehler:

No overload for method 'RegisterStartupScript' takes '2' arguments

Was mache ich falsch?

Liebe Grüße

SeToY

  • Autor

Update (kann ja nicht editieren^^):

Hab's mit dem Code hier hinbekommen:


                ClientScript.RegisterStartupScript(this.GetType(), "alert",

                "<script>alert('" + UnknownError + "');</script>");

Vorher natürlich "UnknownError" als string global versehen ;)

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.