I have been asked to migrate some code to our new asp.net web app. but I am extremely unfamiliar with asp.net.
The following block of code detects the user device and changes the url accordingly. I need to make the same logic using asp.net / c# but I have no clue where to start.
Any help at all is very appreciated.
<xsl:variable name="useragent" select="lower-case(request:getHeader($request, 'user-agent'))"/>
<xsl:variable name="is_iphone" select="string(contains($useragent, 'iphone;') or contains($useragent, 'ipad;') or contains($useragent, 'ipod;'))"/>
<xsl:variable name="is_blackberry" select="string(contains($useragent, 'blackBerry'))"/>
<xsl:variable name="is_android" select="string(contains($useragent, 'android'))"/>
<xsl:variable name="application_url">
<xsl:choose>
<xsl:when test="$is_iphone = 'true'">
<xsl:value-of select="f:getEnvParameter(concat('url.app.iphone.', $param_client), '')"/>
</xsl:when>
<xsl:when test="$is_blackberry = 'true'">
<xsl:value-of select="f:getEnvParameter(concat('url.app.blackberry.', $param_client), '')"/>
</xsl:when>
<xsl:when test="$is_android = 'true'">
<xsl:value-of select="f:getEnvParameter(concat('url.app.android.', $param_client), '')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="application_url_exists" select="string-length(string($application_url)) != 0"/>